Hello everybody, okay so I was following this tutorial to set up Instantiate in my 2d side scroller game that I am making…http://unity3d.com/learn/tutorials/modules/beginner/scripting/instantiate
I feel like I must be making some stupid mistake. The clones of the projectile just stay in place where my character is at any given time… I have kinematic set to off and I tried changing the RocketPlace transform position to see if it was facing the wrong direction… totally stumped on this and not sure what to do… any insight? Thank you -Gene
using UnityEngine;
using System.Collections;
public class UsingInstantiate : MonoBehaviour
{
public Rigidbody rocketPrefab;
public Transform barrelEnd;
void Update ()
{
if(Input.GetButtonDown("Fire1"))
{
Rigidbody rocketInstance;
rocketInstance = Instantiate(rocketPrefab, barrelEnd.position, barrelEnd.rotation) as Rigidbody;
rocketInstance.AddForce(barrelEnd.forward * 5000);
}
}
}