Jump to content
mihaid

helicopter movement

Recommended Posts

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

Share this post


Link to post

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: 

 

Share this post


Link to post

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

Share this post


Link to post

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.

Share this post


Link to post

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

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...