- Home /
Bullet moving backwards with Hermite Spline Controller
Alright...I have no idea what's going on here. I've been working on a bit of an on-rails shooter, and my bullets have been constantly moving backwards. No matter how much force I add to them, they refuse to move forward unless the player is moving backwards. using UnityEngine; using System.Collections;
public class shooting : MonoBehaviour {
public GameObject bullet;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetMouseButtonDown(0))
{
RaycastHit hit;
Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, 5000f);
GameObject myBullet = Instantiate(bullet, transform.position, Quaternion.identity) as GameObject;
myBullet.transform.LookAt(hit.point);
}
}
}
I'd appreciate it if someone would lend me a hand here.
The issue is likely in your bullet script. Where is the code that is making your bullets move?
Right, the question is pretty pointless without that information. On the other hand we don't need to know how you instantiate your bullets unless that gives you problems as well.
Are you sure you don't instantiate your bullet "inside" another object? That would cause penalty forces which would push the bullet out of the other object in a pretty random fashion.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How to move the other object without moving the first object? 1 Answer
Making a bubble level (not a game but work tool) 1 Answer
leantween ltspline control points setup 0 Answers