Hi! I wanted to add a crosshair to my fps game, so i added a texturrect node as a child of the camera node of the player. I then added my crosshair as a texture to the node and placed it in the middle. But now i have 2 problems: the first one is that i dont aim anymore when moving my mouse if i have the crosshair. The other thing is that the crosshair doesnt stays in the middle when i change the screen size. Can you guys tell me how to fix those errors?
First person shooter crosshair?
- Edited
- Best Answerset by coding-culture
You can use a center container now with the latest versions of Godot, this sort of thing makes UI placement much easier especially for a crosshair.
https://docs.godotengine.org/en/stable/classes/class_centercontainer.html
As for the the other stuff, that sounds like a scripting problem, so you'll have to post up what your hierarchy looks like as well as the code itself.
Lethn ye thank you i fixed it. The problem with the not being able to aim was because my mouse filter of the texture rect was set to pass and not to ignore.