I want to be able to make an object move forward in ursina, but can't figure out how.
I tried the .forward method but that only gives the direction and I don't know where to go from there.
I want to be able to make an object move forward in ursina, but can't figure out how.
I tried the .forward method but that only gives the direction and I don't know where to go from there.
Do entity.position += entity.forward
to move it forward, while taking rotation into account. If you don't need to account for rotation, entity.z += 1
would work too.
Example where we move forward while the w key is pressed:
from ursina import *
app = Ursina()
entity = Entity(model='cube')
def update():
entity.position += entity.forward * time.dt * held_keys['w']
app.run()