Hiro Posted December 26, 2014 Share Posted December 26, 2014 First of all: this might be pretty basic knowlege, but i didnt find any answers to this in the documentations. (its possible that i just didnt find it) How can i access a entitys properties form within another entitys script? Let me give you a example: I want to Point a entity at another entity. I would think that this would work: (this line is in the script of the entity i want to point at another entity) self.entity:Point(exampleEntity.entity) If i try to execute it, i get the error message: self.entity:Point(PlayerPos.entity) Let me give you another example, i want to move a entity to the position of another entity: self.entity:SetPosition(exampleEntity.entity:GetPosition(true)) If i try to execute it, i basically get the same error message. I dont know what to do about that. I know that there are other ways of pointing an entity at another entity and moving a entity to the position of another entity, but it would be easier and spare me much work to simply do it like this. I appreciate any help Quote Link to comment Share on other sites More sharing options...
Rick Posted December 26, 2014 Share Posted December 26, 2014 I assume the .entity part is a variable name in the script that is attached to the entity? If so the way you get script variables from a script attached to an entity is: theEntityInQuestion.script.variableName Quote Link to comment Share on other sites More sharing options...
Hiro Posted December 29, 2014 Author Share Posted December 29, 2014 Thanks, but is there a way to do this without the entitys beeing attached? Quote Link to comment Share on other sites More sharing options...
Rick Posted December 29, 2014 Share Posted December 29, 2014 I guess I don't follow what you mean by "without entities being attached". Quote Link to comment Share on other sites More sharing options...
Hiro Posted December 29, 2014 Author Share Posted December 29, 2014 hm.. i guess im bad at explaining what i mean Also, i kinda ready your text wrong :\ sry for irritating you I kinda figured it out myself.. it was way to easy and i was overthinking it ^^ Thank you for your help 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.