#Camera moving
22 messages ยท Page 1 of 1 (latest)
sorry, I was a bit distracted ๐ฃ
the problem is the update function needs to not update the translation if you don't move the mouse
But how? ๐ตโ๐ซ
I'm newbie in rust, so I can't imagine that.
Sorry if I look dumb.
if ev.delta.x == 0.0 {
//empty?
}
You missing the += when setting x and y to `camera_transform.translation
it's ok, everyone was new at some point and also I suggested something dumb
on the last 2 lines
OMG
It works!
yes โ๏ธ
Thank you @mental dirge and @hybrid dagger for this help!
no problem ๐
New question, how to add in this code yet ".looking_at()" from Transform?
๐
is this something you want to set the first time the camera is spawned (leaving its rotation staying the same while time goes on)
or do you want it to constantly be updated as the camera moves so it appears as if the camera is locked on at facing something?
I want at the moment add buttons wasd to movement and adapt camera rotation.
I can imagine how the keys wasd will be implemented, but how to add this ".looking_at()" idk.
In docs I didn't find how to query this function.
looking_at is a function on the Transform component
https://docs.rs/bevy/latest/bevy/prelude/struct.Transform.html
Describe the position of an entity. If the entity has a parent, the position is relative to its parent position.
okay ๐