It basically zooms towards a target object as soon as i hit play. I dont want that. I know i need to use the Update() function to seet the input button for this one but I am lost. I want the projectile to hit target only on button press. Thanks…
If you’re going to do anything physics related (such as moving objects in your game), you’ll want to use a combination of Update() and FixedUpdate(). If your shootAt() function will take care of actually firing a projectile in the game, you’ll want to call it in FixedUpdate(). The reason is because Update() is called every frame, and you don’t want a player to be shooting faster or slower just because they have a higher/slower frame rate.