Godot Version
godot 4.4
Question
i’m new to godot i know some basics but when i tried making a crosshair for my tank i didn’t know where to start the barrel does not aim at the center of the screen so how could i align the crosshair to where the barrel is aiming at and always be where the barrel aims and a second crosshair a grayed out one that calculate where the bullet is gonna hit when i’m moving and update the crosshair location, any help is appreciated 
What style of game is this? I’m assuming it’s 3D and you’re in the tank…
Are shots instant, or do they have travel time? That is, if you have a target in your crosshairs and pull the trigger, could that target theoretically move out of the way of the shot before it arrives?
Do shots have ballistics? That is, are they affected by gravity and/or air resistance?
How do you want the player to aim? Are they picking a target, or are they pointing the gun and you want to determine what it will hit at that power/angle? If they’re pointing the gun, do you want to have some gui that shows where to shoot so the shot and a moving target meet up?
Depending on your decisions for those questions, there are a variety of answers. At the simplest end, it could be “put the crosshairs on the nearest enemy, if the player pulls the trigger, damage the enemy…”. At the most complex it would be a ballistics solver (though the math for that isn’t actually that bad…).
1 Like