0

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.

1 Answers1

1

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()
pokepetter
  • 1,383
  • 5
  • 8