mihaid Posted June 28, 2017 Share Posted June 28, 2017 OK, i have a helicopter made by me...i have a script which i need to improve, script attached by helicopter. problem is: at rotation, helicopter freezing for 1-2 seconds, after that working aprox well, when i want to change direction, freezing again sometime...please give me some suggestions what to change to make rotation smooth, not freezing. I know about add Torque, try to implement...dont want to move....etc here is my script attached, Please help !!! bodyhel.lua Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 28, 2017 Share Posted June 28, 2017 Try using PhysicsSetPosition and PhysicsSetRotation. When you are in the UpdatePhysics loop, those should be used. Side note: they are documented commands, but not listed in the entity API. Reported: Quote Link to comment Share on other sites More sharing options...
mihaid Posted June 28, 2017 Author Share Posted June 28, 2017 I tried PhysicsSetPosition instead Move, and PhysicsSetRotation instead of SetRotation....in UpdatePhysics loop.....start game..no errors..bu no movement !! probably forgot something.....i just changed commands...and nothing inside brackets.... Tried again..NOTHING MOVE Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 28, 2017 Share Posted June 28, 2017 Had a quick look: you are not applying the force, you are now setting a position, which is constantly the same. You either take its current position and add the calculated movement or you add force. In case of adding force: if (self.window:KeyDown(Key.Up)) then movez= movez + 0.1 end self.entity:AddForce(0,0,movez, false) --the last parameter indicates local Your forward/backward movement is also inversed. Quote Link to comment Share on other sites More sharing options...
mihaid Posted June 28, 2017 Author Share Posted June 28, 2017 OK !! Thanx a lot, i will try fast what you suggested...need to go now..and about position of helicopter, was created backside...i need to rotate in blender or something else.....if was normal...my helicopter was moving back..not front..that's why i inversed...thanx anyway Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.