How to make a 2d object, when thrown stick to another object orientated the side its touching
I have made a poorly coded version using 4 raycasts, 1 extra collider2D
So all four raycast will be pointing out on the four sides of the player detecting when they start touching a object with the tag "Level". It will then turn the gravity to 0 and will point toward the side that one of the raycasts are touching and set a force going that way.
Like it works good when it wants to but it doesn't work half the time where it doesn't want to stick or rotate at all, the racast aren't tied to the players rotation so they will always be detecting the right sides but I'm just stumped ...
I'll also post the code if needed, the script in total is around 500 lines but that post it's probably around 30 to 50
Yeah, it's almost always better to add code to questions. It's kind of hard to know what's wrong without knowing what you're doing.
Your answer
Follow this Question
Related Questions
Linear speed in one direction 0 Answers
2D Seesaw object starts sliding after loaded with too many rigid bodies 0 Answers
Enemy Ai Rotation not working properly 0 Answers
how can i anchor a point of a sprite to make it swing? 1 Answer
scale a value 0 Answers