Unity Community


Results 1 to 1 of 1

  1. Posts
    12

    Slow update of Instantiated object (C#)

    Hello, I have a code where I instantiate a GameObject when I press space bar.

    Here I instantiate.
    Code:  
    1. if (Input.GetKeyDown(KeyCode.Space))
    2. {
    3.     Instantiate(MainManager.ObjectProjectile, this.transform.position, this.transform.rotation);
    4. }

    And here is the update of the object.
    Code:  
    1. void Update()
    2. {
    3.     transform.position += Vector3.right * 20 * Time.deltaTime;
    4. }

    The application is working good but the problem is that the projectile moves after 1 second has passed.

    EDIT: I removed the Animation component of the imported model and now it works great!
    Last edited by modular; 04-13-2012 at 09:55 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •