0
Under review

Some problems with shooting modules(Crosshair and cursors)

赵西瓜 3 months ago in Shooter updated by Marti (Lead Developer) 2 months ago 4

Crosshair

    • i can't see it when aiming
    • That's ok in the example,But custom is bad。
    • I noticed that the prefab was not created

cursors

    • The lock and chage Visibility did not take effect
    • I can still see the cursor moving across the screen
Unity version:
Game Creator version:
  • Projectile:The direction of flight is down relative to the Crosshair
Under review

Hi!

Because the only character that needs a Crosshair is the player, you need to attach a "PlayerShooter" component onto the Player instead of a CharacterShooter component. This will solve points A and B.

Regarding the crosshair prefab not being created, I'm not sure what you mean. But possibly will be resolved adding the PlayerShooter component to the Player.

As for locking and changing the visibility of the cursor, it's a bit confusing, agree. The thing is that Unity's cursor is very blurry. That's why we decided not use a Texture as the cursor. Instead, we use our own fake cursor, which has better definition.

So all you have to do is call the Cursor action and set it to "Hide Cursor" (so the cursor doesn't appear on top of the crosshair) and lock it at the center of the screen.

Projectile:The direction of flight is down relative to the Crosshair


Can you elaborate a bit more? Not sure what you mean. Some screenshots might help.

Cheers!

I adding the PlayerShooter component to the Player。solved the problem。thanks!

"Hide Cursor"

  • But you can still see the cursor moving


Hmm as far as I'm aware, the Lock Cursor should prevent the cursor from moving around. However, Unity has some safe mechanisms to prevent this from happening in certain situations.

It's best to build a game and try how it will look like in production. Could you try that and circle back?