Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

doubts about script and animation in motion

Discussion in 'Scripting' started by cd9992107, Aug 9, 2019.

  1. cd9992107

    cd9992107

    Joined:
    Aug 9, 2019
    Posts:
    14
    I'm making a simple game, I won't go into details. imagine the following situation.

    an object falling at a certain speed i'm using this script

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class Speed: MonoBehavior {

    Rigidbody rb;
    Vector3 v3;

    void Start () {
    rb = GetComponent <Rigidbody> ();
    }

    void Update () {
    v3 = rb.velocity;
    v3.y = -5.0f;
    rb.velocity = v3;
    }
    }






    first question:

    When I get to a certain point, I want the object to start a new animation without losing rotation. for example when an asteroid enters the atmosphere. I can't script this.

    got confused? can anybody help me? sorry english is not my native language
     
    Last edited: Aug 9, 2019
  2. ismaelflorit

    ismaelflorit

    Joined:
    Apr 16, 2019
    Posts:
    38
    cd9992107 likes this.