- Home /
Using Fixed Joints to simulate a grab skill in 2D
hello everyone, I've been working in Unity for a few days learning how to code some basic stuff. today I was trying to code a Grab like the one that we all used in Super Mario World but Ii found that is quite hard.
I tried with two different ways.
1- I tried to check a Object with a Collider using a Trigger, when it was felt the position of the Object will be changed to a position next to the player and with that the player would decide what to do with the object. it didn't work, the player was being pushed to the opposite side of its direction.
2- I tried to check a Object with a Collider using a Raycast, when it was felt the position of the Object will be changed to a position next to the player and with that the player would decide what to do with the object. the outcome was the same.
3- I'm trying to use a fixed joint, the player will check a collider with a Raycast and this will add a fixed joint to the object to be stuck with the player. the problem in this third one is that I don't know how to add a fixed joint and then how could i release it.
if someone knows hoe to use them or has a good web page that could help me i would be grateful.
Thank you guys.