yes I have. I also tried to give it the character’s socket location. Doesn’t help.
I tracked the position of the item and I noticed that when the snapping/detaching occurs, the item’s location vector values don’t change, but the item still snaps and changes position.
Could it be that when detached, the item is colliding with the character, and the engine resolves the collision by putting the item in the last known valid location ?
it may be far fetched but I’m grasping at straws here lol
Edit :
When i set simulate physics to false on the item, it stays where it should be when detaching.
After some testing, I think the problem comes from switching SetSimulatePhysics from false to true.
It’s like the engine doesn’t take into account all the movement the object does when it’s not simulating physics. And when physics are switched on, it just goes back the last know state when physics were on.
You may need to work with the FBodyInstance that every component has (or is it actor?) It’s GetBody() i think or just BodyInstance or something on the actor.
-detached object’s location will be set to its last location before settings physics to false in the next frame.
I don’t have an explanation, but for those facing this issue, I just work around it by waiting for one frame after detaching the object and setting its position manually.
I’m having a similar issue in 4.12 , it only happens when attaching a networked actor to another networked actor on the client, when I detach and set the physics back on to simulate it warps to the origin.
Any ideas on correct way to fix this, is this a bug with unreal?
The Correct solution for me to this problem is calling “RecreatePhysicsState()” on the component that is simulating physics. You should call this in the same frame after detachment from the parent.