#An issue with my 2 character chain in 2D platformer

1 messages · Page 1 of 1 (latest)

west otter
#

Hi everyone, I wanted some help tackling a small problem in unity

I was trying to make a game where you can play as two characters simultaneously, both characters are tied by a line and that line should have no physics interaction with anything other than the two rigid body 2d characters.

How should I approach this code-wise?

The way I thought about it at first, measure max length through basic trigonometric Pythagoras theorem, then for each character determine the angle of the rope relative to each character's linear velocity using dot product, also using dot product I cancel out the any velocity in an negative direction to the rope direction. Faced the following problems :

a) Both horizontal and vertical velocities don't get cancelled out entirely, both rigid bodies could still move far from each other albeit very very slowly.

b) the character at the bottom moves in a pendulum swing motion once he reaches max horizontal distance from the vertical character.

So I'm not sure what to do, just resort to using character controller? use force as movement? Idk, but please help needed.

queen shuttle
#

Do not crosspost with other channels

west otter
#

Apologies, my first time actually writing in the discord server, where was I supposed to write this?

queen shuttle
#

Either here or in the other channel was fine, just don't post it onto 2 channels at the same time

west otter
#

I was considering to delete my post in beginener

#

ok then, thanks for the info

queen shuttle
#

the character at the bottom moves in a pendulum swing motion once he reaches max horizontal distance from the vertical character.
Should it not swing?

#

that would be what I expect as a player atleast that he can swing on the rope