DarkCastiel Posted December 20, 2021 Share Posted December 20, 2021 Hi, I'm having trouble understanding the syntax. how do I reference an actor or 3D model on the map using the (lua)? in c# i would do something like that crawler.transform.translate (-0.05f,0,0,Space.self); but I just don't understand how to apply this to Leadwerks (LUA) I don't want to use "self.entity" because the script is not attached to the "crawler" can someone explain this syntax to me better? thanks suppose i have to create a variable and attach the crawler.entity or something? function Script:Start() entity = crawler crawler.entity:SetPosition(0,180,0) end Quote Link to comment Share on other sites More sharing options...
DarkCastiel Posted December 21, 2021 Author Share Posted December 21, 2021 I already found the solution, I needed to create a lua script on my npc and referred the selft.entity to a variable to be its name function Script:Start() BigAlien = self.entity end so now i can use for example BigAlien:SetColor(0.0,0.0,1.0) BigAlien:SetRotation(0,-180.0) with a lua script on any npc or object I thought that after putting the model on the map and I just needed to put its name (crawler) but no I need to reference the self.entity inside it to name it in the end now everything makes sense......? 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.