Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: meghapants on July 28, 2016, 02:59:25 PM

Title: Creating 2D Rope & Swinging for Platformer
Post by: meghapants on July 28, 2016, 02:59:25 PM
Hi everyone,

I'm currently working on a 2.5D platformer and have been having a tough time with creating a rope. The models are 3D just for visual appearance, but everything has been set up as 2D objects (colliders, rigid bodies, etc). I've watched a bunch of Unity tutorials and Playmaker tutorials and learned a lot - but I can't get the rope behaving the way I would like.

The player can throw an object, and when that object touches a rope hook it activates the rope (which is a child of the rope hook, initially turned off).

I created the rope out of 6 cubes chained together with 2D hinge joints. Testing the rope in scene by pulling on the last chain seems to be working fine. I put a grip point onto the last segment of the rope that when touched by the player holds the player onto the rope (and does some other stuff mainly related to the animator and character controller). When the player touches the segment of rope they attach, but I would like the rope to swing back and forth when the player has input on the horizontal axis (either keyboard A & D or joystick).

I've tried a few different things:
-Checking for player trigger enter/stay, checking input, last rope segment move towards player. (The closest thing I've found to what I want, but the player still can't really swing... The rope segment just follows the player as the player model freaks out.)
-Checking for player trigger enter/stay, checking input, smooth follow to player. (Caused the grip point & rope segment to rotate on the X axis and thus the 2D box collider fails.)
-Checking for layer trigger enter/stay, checking input, enabling motor and set motor speed on hinge joints according to player - or + input. (Sort of simulates swinging but the player has no control, and rope would often fold up on itself.)

Does anyone have any other suggestions? Thanks in advance.