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.