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
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); });
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
@@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!
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)
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
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
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.
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.
hi bro ! whats your bevy_third_person_camera version? when i type zoom,i got an error "try naming a field: `zoom_bounds: `"
zoom: Zoom::new(1.5, 3.0),
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
@@thedevblog5916 thanks , Your video is very exciting! don't stop bro
It's always fun to write your own third person camera code using equations for spheres :)
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.
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);
});
@@thedevblog5916 yeah, I got your point. It looks like querying the child would be hard. IDK I new to this. Thanks for the explanation.
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
Trying to clarify here: you are wanting the camera to orbit through keyboard input and not the mouse?
@@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.
@@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!
@@thedevblog5916 i will try my best
@@thedevblog5916 i will try to. i will learn rust enough to do it
your lib didn~t work for me in 0.13
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)
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
@@thedevblog5916 thanks so much, great job btw. Very good for someone who knows code but just wants to get the bevy structure down
@@JehMoH Thanks a lot!
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
Thats good it works!
at 1:30 how did u nest the code that fast? is it a hotkey?
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.
how to make first person camera? make huide about this, please
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.