Hi, I have two imported 3D objects (FBX format) from Blender.
Old object will react to the input (arrow keys) but the new object will not react to it.
I am assuming its because I have two objects with GetAxis command…
If I delete the old object will that solve the problem?
Codes for a new object:
using UnityEngine;
using System.Collections;
public class LMPhysicsScript : MonoBehaviour
{
public float EnterySpeed = 10;
public float MainThrust = 20F;
public float RollThrust = 1F;
void Start ()
{
rigidbody.velocity = new Vector3 (EnterySpeed,0,0);
}
void Update ()
{
float thrust = Input.GetAxis("Vertical") * MainThrust;
float rot = Input.GetAxis("Horizontal") * RollThrust;
rigidbody.AddForce(transform.up * thrust);
rigidbody.AddTorque(0,0,-rot);
Debug.Log (thrust);
}
}
Codes for old object:
using UnityEngine;
using System.Collections;
public class TLMPhysicsScript : MonoBehaviour
{
public float thrustfactor = 20F;
void Start () {
}
void Update ()
{
float thrust = Input.GetAxis("Vertical") * thrustfactor;
float rot = Input.GetAxis("Horizontal") * 1F;
rigidbody.AddForce(transform.up * thrust);
rigidbody.AddTorque(0,0,-rot);
Debug.Log (thrust);
}
}