DarkCastiel
-
Posts
2 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by DarkCastiel
-
-
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 thatcrawler.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
how do I move a 3D object without using self.entity
in Programming
Posted
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......?