R.E.Z. Posted March 23, 2014 Share Posted March 23, 2014 Hello, I am pretty new working with the Leadwerks Engine. Want to setup a vent, that rotates. (1) Is there a script in Lua around, that causes this? Neat would be, to be able to see, in which direction the vent rotates (To use different scripts for the ceiling or wall vents) (2) How to set up the rotation speed in that script? Please, might someone help me further? That would really be great :-) C.U. R.E.Z. Quote Leadwerks Standart Edition RTS Creator Link to comment Share on other sites More sharing options...
shadmar Posted March 23, 2014 Share Posted March 23, 2014 entity:Turn() should do it. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
TemplarAsh Posted March 24, 2014 Share Posted March 24, 2014 Aggror has a tutorial on youtube for a rotator.lua file that may work for you, here is the code... angleCounter = 0 function Script:UpdateWorld() --increase angle counter angleCounter = angleCounter + (1*Time:GetSpeed()) --apply rotation self.entity:SetRotation(0,0,angleCounter) --Check to see if we made a full circle if angleCounter > 360 then self.component:CallOutputs("Done rotating") angleCounter = 0 end end Save it as rotator.lua then attach it to the object in the script tab. Hope this is helpful. ~Ash Quote Link to comment Share on other sites More sharing options...
R.E.Z. Posted March 24, 2014 Author Share Posted March 24, 2014 Hello shadmar and TemplarAsh, thank You for Your help. I did run the rotator.lua file. Works Great. Thank You a lot. Have a neat day, C.U. R.E.Z. Quote Leadwerks Standart Edition RTS Creator Link to comment Share on other sites More sharing options...
TemplarAsh Posted March 24, 2014 Share Posted March 24, 2014 Hey R.E.Z., Glad it worked for what you needed. Be sure to check out Aggror's other Lua tutorials on youtube, he is awesome. ~Ash 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.