0
Answered

Shooter Module - Cross Hairs and Grenade direction

Alienmadness 2 months ago in Shooter updated by Marti (Lead Developer) 2 months ago 6

Hey

I had 2 questions regarding the shooter module.  I started by setting up similar guns as you have in the demo.  I created a grenade and a rifle. 

got most of it setup fine.  only 2 minor issues left.

Question 1:  I have setup the grenade, and copied the settings from the demo.  The grenade i've created seems to have the direction wrong, i was thinking it was the muzzle rotation, but i changed it and it didnt really work as i expected.

Notice in this screen shot the character is throwing to the left, but the Trajectory indicator is going to the right.


When i change the muzzle rotation.  it seems to go in the correct direction, but the screenshot below is all i get.  the trajectory doesnt grow with time, as it does when its going the wrong direction.

the result is a throw the seems like its hitting an invisible wall.  and the grenade ends up right next to the play (not a good sign)... ;)

i would say something is wrong with how i setup the muzzle component, but i've even copied yours and i get the same odd behavior.

question 2:  Im using the topdown style of view.  and the crosshairs only target the player.  not the location of the mouse.

Unity version:
2019.3.8
Game Creator version:
1.1.6

Answer

Answer

I was going to post a workaround, but forgot about how the projectile gets instantiated. Could you show where and how the "Muzzle Component" is set? If you set the character to have the muzzle on the Right Hand, make sure the tip of the muzzle is a bit forward (in the Z axis) so it doesn't collide with the character controller.

Another thing that may be going wrong is having other colliders on the character. Can you check if your character has any kind of active collider on the hands or somewhere else?

Here is a video sample of whats going on.

video

Under review

Hmm it's a blind shot, but maybe what's happening is that the grenade is being instantiated inside the character throwing it, and the physics engine goes wobbly.

Can you try increasing value in the Trajectory Offset? Or reducing the Character Controller's radius value.

As for the crosshair issue, the Shooter module doesn't have a crosshair that follows the mouse. You'll need to change the cursor texture using the "Cursor" action if you want to display a crosshair.

I'll leave the ticket as Under Review to see if that worked. If not, please get back to us.

Hey Mari,

The Character Controller's radius value seems to be the problem.  but it only starts working if I change the character controller radius to .01.  Which is to small.  the play cuts through walls and such.  it needs to be at least .30.  but when i use that value, it goes wonky.

the trajectory offset didnt really do anything for this issue, other then moving the trajectory indicator.. which doesn't seem to be the issue.

Any suggestions?

thanks

Answer

I was going to post a workaround, but forgot about how the projectile gets instantiated. Could you show where and how the "Muzzle Component" is set? If you set the character to have the muzzle on the Right Hand, make sure the tip of the muzzle is a bit forward (in the Z axis) so it doesn't collide with the character controller.

Another thing that may be going wrong is having other colliders on the character. Can you check if your character has any kind of active collider on the hands or somewhere else?

i moved the muzzle component more forward as you stated.  this seem to place it outside the character controller capsule and now works fine.

Thanks!

Answered

Awesome! Happy to hear it's fixed!