class Player(Entity):
def __init__(self):
self.controller = Entity(
model = 'cube',
parent = camera
)
super().__init__(parent=self.controller)
def update(self):
if held_keys['a']:
camera.rotation_y -= 50 * time.dt
self.controller.rotation_y = camera.rotation_y
if camera.rotation_y < -360: camera.rotation_y = 0
if held_keys['d']:
camera.rotation_y += 50 * time.dt
self.controller.rotation_y = camera.rotation_y
if camera.rotation_y > 360: camera.rotation_y = 0
Asked
Active
Viewed 234 times
-3

monkut
- 42,176
- 24
- 124
- 155
-
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 20 '22 at 05:13
-
use the built-in [FirstPersonController](https://www.ursinaengine.org/cheat_sheet.html#FirstPersonController)? – Jan Wilamowski May 20 '22 at 05:27
1 Answers
1
entity = Entity(model='cube')
def update():
entity.position += entity.forward

pokepetter
- 1,383
- 5
- 8