SetActorLocationAndRotation is broken

Is anyone able to tell me why SetActorLocationAndRotation is not working in the image below? The actor should be stuck at the origin but it is freely movable. Thank you.

Define freely moveable.

The object is unaffected by SetActorLocationAndRotation.

I have no problems with this in v4.22.3

Does the actor being moved have simulate physics set to true?

Thanks for trying. It is something to do with the physics actor defined in the skeletal mesh. I can’t be bothered trying to fix it.

Is this when the game is running or just in the editor viewport?

The problem is your moving the the Root (scene component[inherited]) only, because Uzi has simulate physics turned on. To debug you just need to get World Location (root) and draw a debug point after you set location and rotation. You’ll see that the root does move.

When a component simulates physics it kinda detaches itself. Scene components do not have physics, nor collisions.

Fix would be to move the root, then move uzi to the roots location/rotation.

[quote=“Rev0verDrive, post:7, topic:137891”]

The problem is your moving the the Root (scene component[inherited]) only, because Uzi has simulate physics turned on. To debug you just need to get World Location (root) and draw a debug point after you set location and rotation. You’ll see that the root does move.

When a component simulates physics it kinda detaches itself. Scene components do not have physics, nor collisions.

Fix would be to move the root, then move uzi to the roots location/rotation.

Thank you. That sorted it.

1 Like

Absolutely! :slight_smile: