小编Cyb*_*osh的帖子

游戏 Ursina 的第三人称视角

我正在尝试与 ursina 制作一款角色扮演游戏。我想让摄像机始终跟随角色的背部。我尝试使用camera.look_at(player),但在旋转时无法让相机旋转到角色的背面。

app = Ursina()

class character(Entity):
    def __init__(self):
        super().__init__(
            model = load_model('cube'),
            color = color.red,
            position = (-0, -3, -8)
        )

player = character()

print(player.forward)

print(player.forward)
camera.look_at(player)
player.rotation_y =180
def update():
    if held_keys['a']:
        player.rotation_y -= 2
    if held_keys['d']:
        player.rotation_y += 2


app.run()```
Run Code Online (Sandbox Code Playgroud)

python panda3d

2
推荐指数
1
解决办法
3235
查看次数

标签 统计

panda3d ×1

python ×1