Recently, I’ve been trying to add a swinging mechanic into my game; Think Spider-man style.
Basically, The reason I’m here is that I need a hand. I’ve messed up somewhere and I’m not sure how.
As some of you may know, my Pitfall when it comes to Blueprints is: Vector maths AND Physics.
And so you can guess why I am sucking creating this swinging mechanic.
Before you suggest, I’ve already read the grappling hook wiki, checked out Peter’s Attack on Titan system (I even updated all the broken code in 4.7 :>) and I’ve scowered the documentation for HOURS trying to find a solution. But I can’t see to figure it out.
So let me let you in on my train of thought:
I’m thinking that I want to do a two traces in front of the player, Maybe spheres or lines, I’m not sure yet. I can do that just fine. But it’s everything after that that is the problem.
You see (I should tell you now that I’m doing this all in a MyCharacter blueprint), my plan was to add a Physics handle at the trace hit location and then grab the player and just let the default stuff do it’s magic and let the player swing until they let go of the swing button, which would destroy the physics handle.
But putting that into code hasn’t really worked out for me.
An alternative method I’ve been thinking of would be to create a wire in 3DS Max and rig it with bones, then set the top two origin bones (That would stick into the wall) as Kinematic and the rest to simulate in PHaT. So when the Player attaches themselves to the rope, they would be following the natural motion of the wire… But is this something that would work out of the box? It’s only a vague idea at the moment (Haven’t had time to try it out) but as it’s untrodden terriory for me, I’m scared to do it in case I mess up!
Third and final solution would be to cut the mechanic out completely, which isn’t what I want to do.
Oh and yes, before you suggest, I also checked out the complicated mess that is the Swing Ninja’s Grapple Blueprints! (Tut tut to the Blueprint coder at Epic that was so messy, Made my inner-clean freak a bit cross!) - I ALSO checked out the write-up from that dude who did the swinging mechanic for Spider-Man 2. Did it help? Not a bit
So yeah, preferably the first method would be excellent, but I have no idea of how to create something psychics like that would stick the player to the wall like a rope so they can swing like they were Tarzan of the concrete jungle. I tried to create a Physics handle but I know in my heart that I’m messing up bad doing that somehow.
TL;DR - Is there an easy way to create a Physics “rope” between the player and a wall so the player can swing on the wall like in the “Awesome” Spider-man games
So yeah, Any help or pointings into the right direction would be MUCH, MUCH appreciated! I’ve almost teared all my hair out on this, so I’m dying to help!
Thanks in advance everyone!
- Ryan S