Jump to content

Does CreateBodyPivot work in lua?


Andy Gilbert
 Share

Recommended Posts

I seem to be able to get nothing from a CreateBodyPivot usin lua?

 

I create the pivot, set its parent and then when i try to get the vlocity, i just get 0?

 

Can any one confirm this?

 

Thanks

Andy

The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do.

 

Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d

Link to comment
Share on other sites

The body apparently needs mass to report velocity even if it is just a pivot... but then it has the unfortunate effect of falling through the scene. Give it mass and then making it a fixed joint instead of parenting seems to work though.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

You can calculate velocity yourself from the Vec3 position difference between 2 frames:

p2 = p1

p1 = pivot.position

speed = sqrt( (p2.x-p1.x)^2 + (p2.y-p1.y)^2 + (p2.y-p1.y)^2 )

Flip 0

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

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...