#Camera moving

22 messages ยท Page 1 of 1 (latest)

brazen wedge
#

My camera broken, please help!

mental dirge
#

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

brazen wedge
#

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?
}

hybrid dagger
#

You missing the += when setting x and y to `camera_transform.translation

mental dirge
#

it's ok, everyone was new at some point and also I suggested something dumb

hybrid dagger
#

on the last 2 lines

mental dirge
#

yes โ˜๏ธ

brazen wedge
#

Thank you @mental dirge and @hybrid dagger for this help!

hybrid dagger
#

no problem ๐Ÿ™‚

brazen wedge
#

New question, how to add in this code yet ".looking_at()" from Transform?

brazen wedge
#

๐Ÿ™‚

mental dirge
#

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?

brazen wedge
#

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.

mental dirge
brazen wedge
#

okay ๐Ÿ˜„

mental dirge
#

I know you're new to Bevy, so it's difficult to know how much of that makes sense to you

#

but the camera3dbundle includes multiple components needed to make a camera work, including a Transform component which handles the position and rotation and scale of an entity