Hello, i got this code to tell the object not to spin around but just tilt alittle.
The problem is that when it slows down it keeps jumping slowly like forever.
Is there any good way to determin if it moves slowly both vx and vy
and then stop the motion?
local vx, vy = object:getLinearVelocity()
local angle = math.atan2(vy, vx) * 360/math.pi
if(angle >= 75) then
angle = 75
elseif(angle <=-75) then
angle = -75
end
object.rotation = angle [import]uid: 9577 topic_id: 15285 reply_id: 315285[/import]
[import]uid: 9577 topic_id: 15285 reply_id: 56462[/import]