okay so I’m using this script for my ball to move with the accelerometer but when I add the speed it starts to bounce like crazy
to be specific when I add “transform.Translate” line that happens I’m still new to this any help will appreciate it
using UnityEngine;
using System.Collections;
public class Accelerometer : MonoBehaviour
{
public float speed = 5.0F;
public bool isflat = true;
private Rigidbody rb;
void Start()
{
rb = GetComponent<Rigidbody> ();
}
void Update()
{
Vector3 tilt = Input.acceleration;
if (isflat)
tilt = Quaternion.Euler (90, 0, 0) * tilt;
rb.AddForce(tilt);
transform.Translate(tilt * speed * Time.deltaTime);
}
}