I tried with "Swept collision" but the problem is still there.
Here is my lua script:
window = Window:GetCurrent()
rotation = Vec3(0.0, 0.0, 0.0)
rotationAngle = 8.0
pressAnyKey = false
function Script:UpdateWorld()
rotation = self.entity:GetRotation()
--Time:Delay(1)
if window:KeyDown(Key.W) and rotation.x < rotationAngle then
pressAnyKey = true
self.entity:Turn(1 * Time:GetSpeed(), 0, 0)
elseif window:KeyDown(Key.S) and rotation.x > -rotationAngle then
pressAnyKey = true
self.entity:Turn(-1 * Time:GetSpeed(), 0, 0)
else
pressAnyKey = false
end
if window:KeyDown(Key.A) and rotation.z < rotationAngle then
pressAnyKey = true
self.entity:Turn(0, 0, 1 * Time:GetSpeed())
elseif window:KeyDown(Key.D) and rotation.z > -rotationAngle then
pressAnyKey = true
self.entity:Turn(0, 0, -1 * Time:GetSpeed())
else
pressAnyKey = false
end
end
I tried with PhysicsSetRotation but I don't get it to work. If I try it, my playground doesn't do anything.
Here it is. It is just a simple ball created in Blender without any uv mapping. The playground is made from primitives.
Ball.zip