So I have an actor class which I am using as a “pick up” item in my game.
-
It’s initial state is with “simulating physics” turned off.
-
Upon a character calling a pickup function I then attach this actor to the character using “Attach Actor to
Component” (I attach it to a scene component in the character class)
-
When the character drops the item I detach it by using “detach from parent”. At this point I also set “Simulates Physics” to enabled, to cause the item to bounce around when dropped
-
When attempting to pick up the item again (step 2) , it attaches, I can see this in the scene hierarchy that the item has been parented under the character, but this time it does not update the Item actor’s position to snap and follow it’s parent.
I’ve tried changing the collision channels, the object collision type, etc, to no avail. I believe it is a bug with Simulating Physics
Unless I’m missing something?
1 Like
Any non-root components that have been physically simulated will have to also be “reattached”. In this case, since the actor is already being attached to something, attach these no-longer-physical components back to the root component of the actor they are part of. In the following picture notice the AttachTo node on the far right.
In this scene i was testing with a Pawn actor that has a static mesh component that i could turn on and off its physics.
I programmed a couple of keys to toggle attachment between two other objects (cube,cone) in the scene. The other sphere actor in the scene was added for a basis of comparison. it behaves as you expect without the additional attachTo code. Because the sphere from a sphere actor is a root component already it behaves as you expect without the additional attachTo node.
Just in case I have not reproduced what you have, let me know how this goes in case there are any additional issues.
3 Likes
yes sir! I believe that did do it Thank you so much
Thanks. This solved a serious headache!
Adding my thanks to the pile. Solved two days of hair pulling for me, much obliged!