Here’s a picture of what’s happening during runtime. Imgur: The magic of the Internet
Here’s my relevant section of code. This script is going on the bullet itself. Basically, when the bullet is instantiated, this script tells it where to fly.
void Start()
{
BulletDir = DestinationPos - transform.position;
Debug.DrawRay(transform.position, BulletDir, Color.yellow, 99999999, false);
}
void Update()
{
transform.Translate(BulletDir * BulletSpeed * Time.deltaTime);
}
I’m sure this is just a stupid mistake on my part, but I believe I’m doing this correctly. The REALLY strange thing to me is that the debug ray is going EXACTLY where it should be going, on top of the big rectangular box. But the bullets, using the exact same destination, and the exact same method of calculating the direction vector, are going off to the right. Like if my math was wrong, you’d think the bullets would be going wildly in the wrong direction, but they’re only slightly off. I’m just confused. Any ideas?