如何在Roblox中翻转重力和玩家?

huangapple go评论110阅读模式
英文:

How to flip gravity and the player in Roblox?

问题

有人知道我怎么在Roblox中翻转重力吗?不仅仅是重力本身,我希望玩家也能翻转,这样他们就可以在天花板上行走,而不仅仅是漂浮。我试图找到如何做到这一点,但没有找到答案。

有人可以帮我吗?谢谢!

英文:

Does anyone know a way I could flip gravity in Roblox? Like not just gravity itself I want the one player to flip too so they can walk on the ceiling and not just float up. I tried to find how to do it but there was no answer.

Can someone help me with it please?

答案1

得分: 1

考虑通过将世界相机轴旋转180度,然后将所有的BaseItems绕它们的Y轴旋转来实现“重力翻转”。

类似于这样:

local rotation = CFrame.Angles(0, math.rad(180), 0)
game.Workspace.CurrentCamera.CFrame = game.Workspace.CurrentCamera.CFrame * rotation

希望这对你有帮助!

英文:

Consider achieving the "gravity flip" by rotating the World Camera Axis by 180 degrees and then rotating all BaseItems by their Y-axis.

Something like this:

local rotation = CFrame.Angles(0, math.rad(180), 0)
game.Workspace.CurrentCamera.CFrame = game.Workspace.CurrentCamera.CFrame * rotation

Hope this helps!

huangapple
  • 本文由 发表于 2023年8月8日 23:33:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/76861072.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定