Unable to correctly get a reference to an actor
Hi all, so I'm attempting to get a reference to three actors, (each has their own object reference variable) and thus get their location.
However when the print node prints their individual locations, all three of them print (0,0,0). This leads me to believe that I'm referencing it wrong. This is my simple script:
As I said, the print string prints (0,0,0) so I'm referencing it wrong.
A bit more info:
Here is my variable defaults/settings for the object reference variable
Thanks a lot!
Well where do you reference them?
You want to water your flowers (-> get the vector) but right now you have an empty bucket (-> a variable) and try to water your flowers with it (-> get the vector from an empty variable)
You either have to store those variables somewhere else and let the actors save the reference there themselfs (which doesn't work here because it hasn't spawned when the actors are created) or you can use "Get All Actors of Class" if there is only one of each actor at any given time. This will provide you with an array. Since you always only have one just get 0 and use that instead of the variable.
I hope this helps.
answered Dec 28 '14 at 04:56 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here