Question by
Dancetrap · Aug 23, 2021 at 05:33 PM ·
rotationmoving platformsticking
Sticking to a rotating object
Hi there So my player is going to stand on a rotating pinwheel and what I want to happen is for him to stick to the pinwheel as he's moving around it. The problem is is that he doesn't stay on it and he falls down. I don't know if it's possible, but if somebody could take a look at it, then it would be very appreciated.
public GameObject player;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnCollisionEnter(Collision collision)
{
if(collision.gameObject.CompareTag("Player")){
player.transform.parent = transform;
}
}
private void OnCollisionExit(Collision collision)
{
player.transform.parent = null;
}
playerposition.png
(28.0 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613042042im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Custom Rigidbody Controller and Moving Platforms 0 Answers
Cancel out the steering rotation returned from a wheel colliders .GetWorldPose(out pos, out rot); 1 Answer
Space/Aircraft rotation 0 Answers
Camera Controller script as a child object,Camera Control as a Child Object for my Player 0 Answers
Object Rotation With Touch 0 Answers