Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Problem with a collisions

Discussion in 'Physics' started by horemhamer, Apr 7, 2019.

  1. horemhamer

    horemhamer

    Joined:
    Jul 9, 2017
    Posts:
    9
    I am trying to make a game similar to some sanctuaries the legend of zelda breath of the wild and I have a problem that when rotating the platform the ball crosses the platform.

    My idea of game:



    Minute: 2:58
     
  2. horemhamer

    horemhamer

    Joined:
    Jul 9, 2017
    Posts:
    9
    My problem:

     
  3. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,434
    The platform must be a kinematic rigidbody, and you must move/rotate it by calling Rigidbody.MovePosition and/or Rigidbody.MoveRotation from FixedUpdate. The ball must be a non-kinematic rigidbody.
     
  4. horemhamer

    horemhamer

    Joined:
    Jul 9, 2017
    Posts:
    9
    Ok thanks I'll try this
     
  5. horemhamer

    horemhamer

    Joined:
    Jul 9, 2017
    Posts:
    9
    I tried to do it with the rigidbody and the same thing happens to me
     
  6. horemhamer

    horemhamer

    Joined:
    Jul 9, 2017
    Posts:
    9
    My code:

    float rotX = Input.GetAxis ("Mouse X") * rotacion * Mathf.Deg2Rad;
    float rotY = Input.GetAxis ("Mouse Y") * rotacion * Mathf.Deg2Rad;

    //transform.RotateAround (Vector3.up, -rotX);
    //transform.RotateAround (Vector3.right, -rotY);
    rb.rotation = Quaternion.Euler(rb.rotation.eulerAngles + new Vector3(0f, rotacion*(-rotX), 0f));
    rb.rotation = Quaternion.Euler(rb.rotation.eulerAngles + new Vector3(rotacion*(-rotY), 0f, 0f));
     
  7. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,434
     
  8. horemhamer

    horemhamer

    Joined:
    Jul 9, 2017
    Posts:
    9
    I've tried to do with that but I can not think of how to do it