Jump to content

helicopter movement


mihaid
 Share

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

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.

 Share

×
×
  • Create New...