I have 2 actors in my scene. And I need to get the position of “Actor_2” while handling some event in “Actor_1”. For debugging i tried to print the position of “Actor_2” in the event graph of “Actor_1”.
The problem is, i only get the initial position of my Actor_2. The “Actor_2” is moving on a spline, so i was expecting that at each frame i would get the new position but a I only get the initia one.
(In the image GetActorOfClass is called be BeginPlay Event. I already did it using EventTick and got the same result.) Can anyone help me? Many Thanks!
So what you’re showing shouldn’t actually show anything
The white line with the arrow is called the Execution line. If a node doesn’t have an execution pin, it’s referred to as a “Pure” node (typically green). A pure node doesn’t do anything on its own, but when they are called upon by an impure node (A node with an Execution pin, typically blue) they are activated, then the impure node will execute its code.
So you need to plug that “Location” variable into something that is part of execution.
Try keeping your “Set Sedan” node, then on EventTick you can place a printstring, then use “Get Sedan” → Get Location → then plug the yellow Location pin into the pink pin on the printstring.
Many thanks for your reply. I learned a lot from it! (I’m really new on UE and still strougling with some basic concepts). I tried what you mentioned, but no change on the output.
What I did:
I have created a event “GettingSecondVehiclePosition”, here is my “Set Sedan”.
In Event Tick, i added a Sequence Node with 3 Nodes. One pin is for the movement my first vehicle, the second is to call the Event “GettingSecondVehiclePosition” and the third pin is to print the string.
So i have hoped that the Print String node will be calling/requesting GetActorLocation to give me the current location of my vehicle.
it runs fine but, I still only getting the first position of my second vehicle.
here the screenshots of my Event Graph.
Event Tick
I “solved” the problem. The vehicle (BP_SEDAN), from which I wanted to get the position, was moving on a spline. Once the vehicle just need to move forward in a straight line, I changed it calculating the new position and setting it with “Set Actor Location”.
Now, in the other Blueprint I getting the correct position from my BP_Sedan.
I supose the problem before was related with the spline.