camera.add_script(SmoothFollow()) doesn’t work. here’s my code:
from ursina import *
class Player(Entity):
def __init__(self):
super(Player, self).__init__(
model='quad',
scale=1,
parent='scene',
color=color.green
)
self.speed = 5
def update(self):
move_direction = Vec2(held_keys['d']-held_keys['a'], held_keys['w']-held_keys['s']).normalized()
player.position += move_direction * player.speed * time.dt
app = Ursina()
player = Player()
camera.orthographic = True
camera.fov = 20
camera.add_script(SmoothFollow(target=player, speed=8, offset=[0, 0, -4]))
app.run()
i tried this script on the other entity, not camera and it works
New contributor
ovenshyt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.