Can't set position of an actor that once had physics enabled

Engine Version:

4.8.2

Steps to reproduce:

  1. Create new project using Blueprint First Person Template
  2. Create a new Blueprint based on the Actor class
  3. Add a new cube component to the Blueprint
  4. Enable Physics on the cube component
  5. Set auto receive input from player 0 on the Blueprint
  6. Add an event to the blueprint for the key “E” to change position (see example)
  7. Place an instance of the blueprint on the map

At this point, if you play the game, pressing “E” does nothing. If you stop the game. disable physics on the cube component, and restart the game, pressing “E” changes the object’s vertical position as expected. This in and of itself is a bug in my opinion.

The bigger bug though, is that if you disable physics simulation in Blueprint, you STILL cannot set the actor’s position. Repeat the same sets as above, but add a node to “Set Physics Simulation” to false on the cube component.

What appears to be happening is that the actor is being moved, but the physics enabled component isn’t (so the local position is changing, but the world position isn’t). See screenshot:

http://new.tinygrab.com/37897525d4e59a901cb419088ecdeb22e63b7c3495.png

Conditions:

In my effort to ensure I provide as much detail as possible, I’ve been looking into the issue more:

  • SetActorLocation works fine if the root component is the component with physics enabled
  • SetWorldLocation works fine IF called on the component with physics enabled but then the physics enabled component and root component get out of sync

Blueprint Component Hierarchy:

http://new.tinygrab.com/37897525d4265786567d24450f16384b6d0027fed6.png

Example Blueprint To Change Position:

http://new.tinygrab.com/37897525d40aa4b0e3e934c920fdcdf3c1ec71b792.png

Example Blueprint To Disable Physics Simulation:

http://new.tinygrab.com/37897525d4e68931737b4228c99f06775dfb70083f.png

Even a hacky work around would be appreciated though, I have found no way to get past this

Hi Brandon,

The reason that this isn’t working is because the GetActorLocation node is setting the location of Self, which is the Default Scene Root. If you swap the Default Scene Root for something that you can see (like a Billboard or StaticMesh component) you will see that the it does move how you are telling it too.

To fix this, you can either set the Cube as the root which will work with your original setup.

Or make a direct reference to the Cube.

If you have any other questions just let me know.

Cheers,

TJ

2 Likes

it didnt work for me even when i set simulate phusics to false

HI BRS Office,

I just tested this in 4.12.2 and it is working on my end. Feel free to post a screenshot of your setup or a small test project and I will see if I can help.

TJ

Thanks, this solved a similar physics get location problem for me too