Search Unity

Question How to Sit in a chair in unity

Discussion in 'Animation' started by chitogekirisaki0104, Dec 18, 2022.

  1. chitogekirisaki0104

    chitogekirisaki0104

    Joined:
    Dec 18, 2022
    Posts:
    2
    Hello.
    Do you have a simple tutorial for sitting in unity? Like there is a arrow in chair and when you click the arrow you will sit?
    Thx
     
  2. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
    Hi

    How about something like this?
    Code (CSharp):
    1. void OnClickOnChairArrow() {
    2.    player.transform.position = chairPosition;
    3.    player.transform.rotation = chairRotation;
    4.    animator.Play(SitAnimation);
    5. }