Hi,
I’m pretty new to UE, and I am trying to update the position of my enemy object.
I’ve got an array of “CurrentEnemies” (which is an array of actors of the class Enemy). When I try to set the location of the first item, nothing happens and the actor is not moving…
I tried to set the GET as copy AND ref, and it still doesn’t work… Current Enemies does have objects in it. Enemy fight position is also initialised properly.
Any idea what I could be doing wrong ? How can I achieve that ?
Yes, that what I want - just set the new position of my actor
It is in a function that set other actors position (camera and player). The setactorlocation works fine for these other 2 !
Well, the code looks normal it can be the next 1.The code doesn’t run you can check if it does by pressing F9 while you on SetActorLocation if you run the game and it doesn’t stop it means that the code doesn’t run. 2.It can’t be a null in the current enemies or it would gave you an error, so the other thing that it can be is the position do a Print Sring after the SetActorLocation and drag the position into it, it will print the position on runtime if it doesn’t print it means code doesn’t run. Check this out and tell me what you get.
This node is part of a function that also set the player position and the camera position using SetActorLocation too, and it works fine for these other 2 !
Ok, I just did a print string on the return value of SetActorLocation - it shows false ! So for some reason, the SetActorLocation failed… Any idea what it could be ?
Also note (i don’t know if it matters) : the enemy blueprint is a PaperSpriteActor