+2
Answered

Shooter Module First Person

Crispy 3 weeks ago in Shooter updated by Marti (Lead Developer) 1 week ago 6

Currently it doesn't work with FPS arms because it expects a humanoid model.

Please make it work with FPS arms. I don't think it'll be hard. The Weapon and Ammunition objects just need to be more generic. Also, under 3D Model where you insert a gun to be attached to the hand, that isn't necessary, because the 3D Model should be parented to the Main Camera.


The following free asset is really good as it has everything from animations to sounds. It has 2 weapons, so you can set up draw and holster weapons, which I'm having trouble with. I've seen a developer use it in a tutorial video as well, so maybe you can make a video and kill two birds with one stone :) https://assetstore.unity.com/packages/3d/props/weapons/low-poly-fps-pack-free-sample-144839


For the Weapon object, I think it'll be useful to add a "On Aim" and "On Ease" action list like what you have in the Ammunition object.

Unity version:
Game Creator version:
1.0.4

Answer

Answer
Searching answer

You are mixing two complete systems. Game Creator requires a certain set up and the example that comes with the package you mention is set up differently. How Game Creator camera works is by copying the Player's position and rotation and transferring that data to the main camera. So, the idea is that the Character/Player moves around the scene, and it's the camera that follows up.

For the hands to point to where the camera looks at, we have created a forward kinematic algorithm that procedurally bends the spine and shoulders of the character. Your 3D model should be a humanoid in order for Game Creator to read each spine bone and apply the correct rotation.

If you want to use a non-humanoid character, you can still do, but you'll have to get creative. You can hide the Player/Character model and use the other package's set up (parenting the 3D model under the camera) but you are not getting access to the Muzzle Component, which is required in order for the Shooter module to know where the tip of the gun is and its direction.

Using a non-humanoid character that requires up/down movement is not doable at the moment. I'm opening a ticket, but it's not something that can be easily changed.

In Discord you told me arms should be a model of the Character when using the FP Motor, but: https://streamable.com/790ip Arms have to be parented to Camera or it will not work. I've checked tutorials and that's how they do it as well. Please actually try doing this yourself, to better understand it.

Answer
Searching answer

You are mixing two complete systems. Game Creator requires a certain set up and the example that comes with the package you mention is set up differently. How Game Creator camera works is by copying the Player's position and rotation and transferring that data to the main camera. So, the idea is that the Character/Player moves around the scene, and it's the camera that follows up.

For the hands to point to where the camera looks at, we have created a forward kinematic algorithm that procedurally bends the spine and shoulders of the character. Your 3D model should be a humanoid in order for Game Creator to read each spine bone and apply the correct rotation.

If you want to use a non-humanoid character, you can still do, but you'll have to get creative. You can hide the Player/Character model and use the other package's set up (parenting the 3D model under the camera) but you are not getting access to the Muzzle Component, which is required in order for the Shooter module to know where the tip of the gun is and its direction.

Using a non-humanoid character that requires up/down movement is not doable at the moment. I'm opening a ticket, but it's not something that can be easily changed.

Solution:

1) After dragging in the 3D Model, move the child of Player to be child of your camera.
2) The prefab with the Muzzle Component should just be an empty gameobject. This is what you insert under 3D Model in the Weapon object.
3) In order for the Muzzle to move with your gun, you have to parent it to your gun at runtime. You can't put something like "On Start" -> "Parent to gun", because it can't reference scene objects when it hasn't been instantiated. But what you can do is "On Start" -> "Store gameobject as Global Variable". Then this image should explain the rest:

The error still exists, but I think you can just add an option to turn off the procedural animations.

The latest Shooter module should fix this issue. Once you try it, please let me know if the error still pops or not.

Error is gone.

However, my method above doesn't actually work: https://streamable.com/0r12r
The Muzzle does not follow the animation of the Player (I used Character Model Action to change arms, then parented Muzzle to the arms). I think the Muzzle and the arms have to be one instance. So what I think we need is the ability to change the Player Model to a prefab that contains both the animator and Muzzle.

Answered

That is currently not possible. We're opening a ticket for a future version but we're not going to implement this since it would mean redesigning a great deal of the Shooter module.