This is code for a turret that shoots lasers at a person. I've gotten all the code down but it's spawning lasers that are upside down and not aimed at the player.
My code works perfectly so far. How do I fix this?
void SpawnLaser(int iter) { for (var j = 0; j < 5; j++) { Vector3 pos = transform.position; var rotation = transform.rotation; rotation *= Quaternion.Euler(0, 90, 0); Instantiate(projectile, pos, rotation); } }
One more thing, in unity, the lasers are not colliding with the player. Why?
https://stackoverflow.com/questions/66959392/rotating-quaternions April 06, 2021 at 04:29AM
没有评论:
发表评论