I have a plane object in game as bullet, i want to shoot that bullet but I cant rotate it because it is just a plane object with texture, but the game space is in 3D, how can i shoot that bullet toward player without rotating it? it doesnt have to be tracking the player’s position, but just when first initiate the bullet, its direction has to be toward the target player without rotating it. Thanks very much!
“Normal” bullet code says to aim at the player and then move along your current forwards. To skip the aiming step, just figure out what your forward line would have been if you were aiming, and shoot on that:
// WITH AIM: //bullet.LookAt(target); // aiming //bullet.rigidbody.velocity = bullet.forward*10; // push along my forwards // NO AIM: // figure which way LookAt would have aimed you: Vector3 toTarg = (target.position - bullet.position).normalized; // toTarg is now exactly what bullet.forwards would be if we aimed bullet.rigidbody.velocity = toTarg*10;