Bevy 3d Third Person Tutorial | Part 4 | Third Person Camera

Поділитися
Вставка
  • Опубліковано 12 січ 2025

КОМЕНТАРІ • 26

  • @Cat_trot2333
    @Cat_trot2333 Рік тому +4

    hi bro ! whats your bevy_third_person_camera version? when i type zoom,i got an error "try naming a field: `zoom_bounds: `"

    • @Cat_trot2333
      @Cat_trot2333 Рік тому +1

      zoom: Zoom::new(1.5, 3.0),

    • @thedevblog5916
      @thedevblog5916  Рік тому +3

      Yeah sorry about that!! I've released a few versions since this video. I'll update the description to let others know before they get stuck in the same problem

    • @Cat_trot2333
      @Cat_trot2333 Рік тому

      @@thedevblog5916 thanks , Your video is very exciting! don't stop bro

  • @DavidShure-p6p
    @DavidShure-p6p Рік тому +1

    It's always fun to write your own third person camera code using equations for spheres :)

  • @billymosis
    @billymosis Рік тому +2

    I look at the code and you using something like sync camera and player. Is it possible to spawn camera as child? Like in godot to be spring arm.

    • @thedevblog5916
      @thedevblog5916  Рік тому +2

      Thats a great question and I struggled with that for quite awhile! It is possible, however that makes things very restrictive. In the next video I show how to rotate the player object to face in the direction he is moving. If you were to add the camera as a child entity and then apply a rotation to the player, then the camera transform will move as well, which is not what we would want. Spawning the camera as a child entity will always make it relative to the player, so any movement at all the happens to the player will also happen to the camera. Does that make sense?
      This is how you would spawn it as a child though:
      let player = [PlayerObject]
      let camera = [CameraObject]
      commands.spawn(player).with_children(|parent| {
      parent. Spawn(camera);
      });

    • @billymosis
      @billymosis Рік тому +3

      @@thedevblog5916 yeah, I got your point. It looks like querying the child would be hard. IDK I new to this. Thanks for the explanation.

  • @RishitSrivastava007
    @RishitSrivastava007 11 місяців тому

    Hi I want to know if there is a way to currently use the sync_player_camera function to check for other systems such as keyboard input ? I want my entity to be controlled through keyboard only so it would be good if camera can orbit through keyboard aswell

    • @thedevblog5916
      @thedevblog5916  11 місяців тому

      Trying to clarify here: you are wanting the camera to orbit through keyboard input and not the mouse?

    • @RishitSrivastava007
      @RishitSrivastava007 11 місяців тому

      @@thedevblog5916 indeed. think of it as controlling a car. you always want to see whats in front of you but you use only keyboard to control it.

    • @thedevblog5916
      @thedevblog5916  11 місяців тому

      @@RishitSrivastava007 I see! I'll take a look at it and see if that would be easy to implement. Or if you'd like you can always contribute to the project as well!

    • @RishitSrivastava007
      @RishitSrivastava007 11 місяців тому

      @@thedevblog5916 i will try my best

    • @RishitSrivastava007
      @RishitSrivastava007 11 місяців тому

      @@thedevblog5916 i will try to. i will learn rust enough to do it

  • @snk-js
    @snk-js 7 місяців тому

    your lib didn~t work for me in 0.13

  • @JehMoH
    @JehMoH Рік тому

    is there a way to modify crates? e.g. I want to use your space bar functionality (lock/unlock camera movement) only on HOLD right-click. I.e. you see/control mouse, but you hold right-click to look around/transform player)

    • @thedevblog5916
      @thedevblog5916  Рік тому

      Hey! If you'd like, you can take a look at the github project, make a fork and modify it from there. Then you can just reference that local fork that you made in your cargo.toml file instead of the published crate.
      github.com/AndrewCS149/bevy_third_person_camera

    • @JehMoH
      @JehMoH Рік тому +1

      @@thedevblog5916 thanks so much, great job btw. Very good for someone who knows code but just wants to get the bevy structure down

    • @thedevblog5916
      @thedevblog5916  Рік тому

      @@JehMoH Thanks a lot!

  • @abacaabaca8131
    @abacaabaca8131 Рік тому

    I do not know how it works, but after trying to modify the "ThirdPersonCamera" 's attribute,
    named "zoom_bounds" which expects a tuple for min and max bound of the camera suddenly the camera can zoom out further than the default values which is :
    ThirdPersonCamera{
    zoom_bounds:(1.5,3.0),
    ..default()
    }
    but I tried:
    ThirdPersonCamera{
    zoom_bounds:(0.0,100.0),
    ..default()
    }
    and it works

  • @crishcrish8212
    @crishcrish8212 Рік тому

    at 1:30 how did u nest the code that fast? is it a hotkey?

    • @thedevblog5916
      @thedevblog5916  Рік тому

      I believe it was one of my formatting extensions that runs when I hit save (Ctrl + s). It might have been the "prettier" extension. Also, I have the "rust-analyzer" extension installed.

  • @abobunus
    @abobunus Рік тому

    how to make first person camera? make huide about this, please

    • @thedevblog5916
      @thedevblog5916  Рік тому

      I don't have any plans to make it a dedicated first person camera. You can try putting the zoom into something very small and it might have the same effect. I can try that when I get home on Monday or Tuesday and let you know.