from ursina import *
from ursina.prefabs.first_person_controller import FirstPersonController
class Voxel(Button):
def __init__(self, position):
super().__init__(
parent=scene,
position=position,
model='cube',
origin_y=0.5,
texture='white_cube',
color=color.white,
highlight_color=color.lime
)
app = Ursina()
for z in range(8):
for x in range(8):
voxel = Voxel(position=(x, 0, z))
player = FirstPersonController()
app.run()我在一个基本的“我的世界”克隆版上学习这个教程来学习Ursina,但是当我像他在教程中那样添加FirstPersonController类并启动这个游戏时,只要鼠标移动一点点,相机就会旋转一万亿次。它还指向直接向下,无论我如何移动他们鼠标,相机旋转时,向下看。此外,我也有以下错误:
Known pipe types:
glxGraphicsPipe
(4 aux display modules not yet loaded.)
:pnmimage:png(warning): iCCP: known incorrect sRGB profile
:pnmimage:png(warning): iCCP: known incorrect sRGB profile但是实际的窗口仍然有效,所以我一直忽略它。它被抬高,即使只是
app = Ursina()
app.run()不知道这是否重要,我只想提一提。
发布于 2022-09-28 12:11:24
如果第一个人控制器是快速的,我将使用命令改变播放器的速度。
player.speed=your speed choice i recommend 1 for slow但是如果我不想那样做,我就没有答案了。
https://stackoverflow.com/questions/73593271
复制相似问题