This question was
closed Apr 20, 2016 at 07:12 AM by
meat5000 for the following reason:
The question is answered, right answer was accepted
Question by
Chase-Does · Apr 20, 2016 at 02:15 AM ·
skateboardon and off
Skateboard You can get off
I want to have the ability to get on and off a skateboard in my game and have it act like a skateboard
Comment
Best Answer
Answer by TBruce · Apr 20, 2016 at 04:49 AM
@Chase Does
You need to parent the rider to the skateboard when the rider is on it. And un-parent the rider from the skateboard when the rider gets off. For example
GameObject skateboardRider;
GameObject skateboard;
// skateboardRider gets on skateboard
skateboardRider.transform.SetParent(skateboard.transform, false);
// skateboardRider gets off skateboard
skateboardRider.transform.parent = null;
Follow this Question
Related Questions
Spawn skateboard under player 0 Answers
How to make the skateboarder rotate 0 Answers
Skateboard physics and Wheel Colliders 1 Answer
Hinje joint doesn't let a skate move freely,Hinje joint doesn't let a car move freely 0 Answers
When key pressed addforce,How do I add force when key pressed. Skating physics 0 Answers