- Home /
Question by
sharmashivam2419 · Nov 21, 2018 at 04:35 PM ·
rigidbody
i do not know why gravity is not working on rigidbody sphere.
i added rigidbody component to sphere object but after hitting play button sphere did not moved i checked for 4-5 mins but still did not worked. i also check time scale value which is set to 1. please me to solve my problem.
Comment
Answer by sharmashivam2419 · Nov 21, 2018 at 04:53 PM
i checked later that after deleting player script its working fine.
using System.Collections;
using System.Collections.Generic; using UnityEngine;
public class playercontroler : MonoBehaviour {
public int speed = 10;
private 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);
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612182528im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Collision script don't work. 1 Answer
drag rigidbodies script 1 Answer
Collision triggers do not work on child gameobject 3 Answers
climbing the hill? 1 Answer
Can i make more gripped rigidbody sphere Controllers 0 Answers