StaticMesh gets de-attach from physics object when
Hi there, this is my first time posting here.
My setup is a character that i want to be able to pickup an item (Pickupable blueprint). From start all instances of Pickupable have Simulate Physics set to off. When i pick them up and attach to my actor.
So basically i disable Simulate Physics (in case it was set), so it doesent fall out of our hand. Disable collision so it doesent keep colliding and then call AttachActorToComponent to put it into our socket.
When i wanna drop the item, i DetachActorFromActor, Renable Collision and Physics.
The Item i pickup is shown here:
So actually i have made a Interactable -> Pickupable -> Weapon -> m4a1-s and what i put in my level is the m4a1-s blueprint.
In my Level it looks initially like this(billboard and mesh and interactionsphere are all neatly together):
Problem is shown here. When i pickup an item and dropped it, the billboard have been detached from the StaticMesh.
How do i get the object hierarchy restored proberly?
If at all possible point out where i've done something wrong(and if someone has a link to a good ressource that explains this better in depth, i would very much appreciate.
asked Oct 25 '15 at 10:53 AM in Blueprint Scripting
Ok i figured it out myself. I ended up with a simpler component hierarchy. Static Mesh (as root) - InteractionBox (CollisionBox) - Auto Weld (uncheck) which ensures the CollisionBox does not inherit the collisionsettings from my Static Mesh.
When i pickup my item i disable Physics and collision and right after i make sure to re-attach my Static Mesh to the RootComponent,
When i drop it again, i detach actor (item), enable Physics and collision and finally i Attach my InteractionBox to Actor again with "Weld Simulated Bodies" off.
If someone can come up with a more elegant solution to this, im keeping this question open for a bit more. But will resolve it if i don't hear from anyone.
Follow this question
Once you sign in you will be able to subscribe for any updates here