- Home /
Advance seesaw effect
Hi everyone,
I have the following problem and i'm struggling to solve for some time. Suppose we have 2 objects (P1 and P2) and other object S between them. Based on user input S object is moved for example to left side, then P1 is going down on Y axis and P2 is going up with same amount. Also S most follow the trajectory (a straight line between P1 and P2).
How can I calculate the amount on Y movement if S moves 5 units for example? My best formula until now is: yPlayerMovement = (S.x maxPlayerDown)/S.x + distance(S,P)*
For S to follow that trajectory i use MoveTowards, but is not precise now (in my case P1 and P2 are heads of players). Any ideea of how can i improve that?
If i use physics ie a plane and S object (gravity on) on him, and i change the velocity of that object, S makes plane to incline to much and doesn't stop (drag is set to 0.5).
Thx a lot !