I posted about this in another thread but noticed it was quite dated and referring to another version.
In 4.8 it appears setactorlocation isn’t working at all. I created a basic blueprint to test it but nothing I attempted worked.
I’ve attempted disabling physics on the object temporarily and using other similar commands like setactorlocationandrotation, but it has the same issue. I tested the blueprint in 4.7 and it worked perfectly.
I’m currently using movecomponentto as an alternative but there are some obvious shortfalls with using this.
Was hoping someone could shed some light onto why this isn’t working or even if they do or do not have the same issue.
I haven’t had any problems with SetActorLocation (using 4.8.2).
I realize this is a simplified test, but it’s hard to tell what you tried in your actual project. Are you sure the input gets through correctly? Also, you’re changing the Z position. Could gravity interfere with that?
Hi, Thanks for your answer.
I too am using 4.8.2
I was setting the Z to 200 so that it wouldn’t be moving to under the ground in the default 3rd person starter map. In my tests on 4.7. It was functioning correctly, the exact same set up in 4.8 wasn’t. I had a friend test it on his computer and I tested it on my laptop all systems behaved the same.
I came across the issue trying to make a simple soccer prototype that reset the position of the ball after a goal was scored.
I’ve done nothing different to the default 3rd person template. At begin play, I spawn the actor into the world with the “T” event at 500 units in front of my character based on location/rotation.
Then I go into the mesh BP just as you did and enter the same code, except I get the actors location and add 100 to the Z axis so that way each time I press “E” it continues to move upward rather than simply set it’s location in the world at (0, 0, 200) like yours does.
And everything works fine for me! I didn’t have to mess with any physics, everything is virtually default of the 3rd person template.
Hopefully you see something here that you may have missed. Oh, and BTW I’m using 4.8.3 but I have never had any issues with SetActorLocation in any version from 4.7 - now.
If you turn on simulate physics via any means does your object lose its ability to be moved via this?
Your set up works for me as long as the object never simulates physics.
I’ll check this in the morning for you if you haven’t already solved your problem
Ah yes, physics appears to be the only difference. With Simulate Physics activated, I can reproduce this, too.
Could be a bug. After all, a quick search brought up the fairly similar I can't use Set Actor Location on a child BP that has physics turned on for the mesh - Blueprint - Epic Developer Community Forums which also still exists.
That’s such a relief, I was beginning to think I was going crazy, or overlooking something really rudimentary. Thanks for trying it out. You’ll notice I posted on the other thread before I made this one, as this is my first time actually posting here I wasn’t sure if that thread was dead/closed or not.
Hopefully there is a fix for this soon.