【问题标题】:Ursina FirstPersonController camera moving way too fastUrsina FirstPersonController 相机移动速度太快
【发布时间】:2022-09-28 20:11:24
【问题描述】:
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()

我在一个基本的 Minecraft 克隆上按照本教程学习 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()

不知道这是否重要,以为我会提一下。

  • 无法使用 Python 3.9.7 和 Ursina 4.0.0 重现
  • 必须初始化一些属性,忘记叫什么了,反正现在已经修好了。谢谢你的尝试。

标签: python camera ursina


【解决方案1】:

如果第一人称控制器要快,我会使用命令改变玩家速度

player.speed=your speed choice i recommend 1 for slow

但如果不想那样做,那么我没有答案

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-07-26
    • 1970-01-01
    • 1970-01-01
    • 2019-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多