I am a beginner to the unity. I am making a rolling sphere game. In my game after all the code written in c# script, my directional light is moving from up to down instead of sphere. Object is not moving at all.
Can anyone help me how can i fix this error?
My code is shown below :-
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class New_script : MonoBehaviour {
public float speed;
public Rigidbody rb;
void Start ()
{
rb = GetComponent<Rigidbody>();
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rb.AddForce (movement * speed);
}
}