I’m working on a grab-and-throw system where the player can grab enemies, hold them, and release or throw them when they choose. I have a general idea and some blueprints ready. Could you assist me in refining it? I’d appreciate any guidance @Mind-Brain
Hey @Tempest004!
We’re here to learn together so let’s do that! Granted we can’t just make the whole thing for you usually but we can offer guidance if you show us what code you have, and what it’s doing!
Get back to us!
@Mind-Brain I totally get it. I’m really here to learn. I wouldn’t expect someone to just do everything for me, because then I wouldn’t feel proud of what I created. I already have a basic idea of what I want, I just need someone more experienced to guide me and answer my questions along the way. That’s all
Basically, I set up a sphere trace that, when it hits my dummy actor, triggers an Attach Actor to Component function, attaching the dummy to a socket on the player’s hand (specifically the ‘grab socket’). After that, I initiate a ragdoll effect, which feels pretty good so far. I plan to add physical animations to the ragdoll later to enhance the feeling of the dummy struggling in the player’s grip. However, when I enable the ragdoll, the dummy detaches itself from the player socket. For the throw, my initial idea was to use Detach Actor and then maybe apply an impulse to simulate the throw
I see what you’re doing! Got some good work so far.
So I will suggest that you actually do not use physics when attaching an actor to an actor, because it will ignore the attachment. You could, theoretically, add location constraints, but it will be very finnicky. What you can do instead is on pick up, set the simulate physics to false, then on throw, detach from actor, Set Simulate Physics = TRUE, THEN apply impulse, one after the other! That way it’s ragdolling before and after the pickup. If you’re applying animations anyway while they’re held, it’ll still look good!
Thanks for the suggestion! I’ll give it a try and let you know how it goes right away
Off the top of my head. In the character that is grabbing or holding make a socket or just use the hand bones for the socket. Use the Attach actor or component node to attach the held item to the holder’s socket. Hopefully have an animation during this attach.
Throwing is when you detach. Then depending on what it is you might use physics or force or just another delta based propulsion method. But I think like a lot of use you may encounter issues when trying this quick attach and then detach stuff. I think many have alleviated the problem by making sure the mesh was the default root component. But you might want to make a duplicate of that bp before messing with that.
Alright, will try out the suggestion