FortifyThisMFker! Posted October 26, 2017 Share Posted October 26, 2017 I was making some gibs right now and got stuck at an initial spin to the entity. Is there a way to set a rotation velocity? Quote Link to comment Share on other sites More sharing options...
gamecreator Posted October 26, 2017 Share Posted October 26, 2017 Turn? https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_Turn Quote Link to comment Share on other sites More sharing options...
FortifyThisMFker! Posted October 26, 2017 Author Share Posted October 26, 2017 An idea might be to set a variable for a velocity to use on Turn, and subtract form it over time to simulate a dying spin. then once you collide you need to stop that update and let physics take over? Quote Link to comment Share on other sites More sharing options...
gamecreator Posted October 26, 2017 Share Posted October 26, 2017 Oh, if you want it to be a physics body that flies and spins by itself, you can just use the physics commands like AddTorque. https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_AddTorque Check out the other entity commands here: https://www.leadwerks.com/learn?page=API-Reference_Object_Entity Quote Link to comment Share on other sites More sharing options...
Josh Posted October 27, 2017 Share Posted October 27, 2017 SetOmega sets rotational velocity: https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_SetOmega Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
FortifyThisMFker! Posted October 27, 2017 Author Share Posted October 27, 2017 Thanks gamecreator and Josh, I used SetOmega in the Start function and it works perfectly. I'll try playing with AddTorque on my next project, which I think I want to try something like Descent and Forsaken 64. self.entity:SetOmega(Vec3(math.random(-8, 8), math.random(-8, 8), math.random(-8, 8)), true) 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.