Struck Arrows not Disappearing

1. Character Controller Type: UCC
2. Unity Version: 2018.2.5f1
3. Bug Description:

Hey. When I shoot an enemy character with an arrow, the arrow seems to be stuck on the character. But when the character dies, the arrow seems to stay in the air, even while the dead character will perform a ragdoll death. If the character's respawn is turned on, then the arrow will move back to the location of the respawned character. If the character is disabled after death, then it will just remain in the air. Any hints on what I should do to make the arrow completely stick with the character.

Also, there seems to be a small distance between the shot character and the arrow. Does the arrow stick on the capsule collider? Is there a way to arrange how far in the arrow will penetrate into a target?

Thank you.

4. Steps to Reproduce: Built a 2.5D scene and character from scratch following the video tutorials verbatim. (copy/pasted some of the component values from the Nolan character)
 

Attachments

  • ezgif.com-video-to-gif.gif
    ezgif.com-video-to-gif.gif
    248.5 KB · Views: 13
What is the clip size of your arrow? Whenever this has happened for me it is because the clip size isn't 1 (the arrow/shootable weapon are not aware that the character is in the 2.5D movement type)

If the character's respawn is turned on, then the arrow will move back to the location of the respawned character. If the character is disabled after death, then it will just remain in the air. Any hints on what I should do to make the arrow completely stick with the character.
On the trajectory object ensure the movement settle threshold is 0 so the arrow will still update. When it hits the object it'll reparent itself to that object if the scale is uniform - if your base collider isn't moving then the arrow won't know to move.

Does the arrow stick on the capsule collider? Is there a way to arrange how far in the arrow will penetrate into a target?
Yes - you can adjust the capsule collider size in order to have it stick further into the target.
 
The clip size is set to 1, as I followed (almost) everything verbatim on the tutorial video.

But I noticed couple of other things, and had a few other questions:

1) When the arrow hits, it is parented under the parent enemy object instead of the part of the rig it hits. That is why it remains on the collider. If I keep shooting, a second arrow will actually hit the part of the rig and be parented under that part of the rig. Is that normal? Is it supposed to be parented under the rig in the first place?

2) I wanted to use the size of the capsule collider to determine other game utilities such as the hitbox of the character and whether he may pass through a certain hole or not. Is there (or could there be) another way to adjust how much the arrow should sink in? I will try to change the collider of the arrow, and leave the front empty to determine how much it will sink in, but an inspector component under the bow or the projectile would be great.

3) I had to make a few changes during bow setup as some of the things that worked in the video, did not work in my setup, so I tried to find a way around. In the original Nolan character (maybe his bow is picked up in runtime, and that could be the case) what I see is that there is an attachment point, and there is a childed fire point, and arrow spawns under that. In my case, even though I introduced both of these, the arrow is childed directly under the player character in the hierarchy. It will retain the transform, and it will be pulled back, but apparently I cannot adjust it by adjusting the attachment point when I pause the game during the draw, as it has a different parent. I am not quite sure what I did wrong, so maybe I should just rebuild it after the next release.
 
Are you running the latest version of the character controller? A way to verify it is to look at the welcome window and it should show videos/discord links. I'm not able to reproduce some of the items that you are describing and you should be able to follow along with the video precisely.

1. It'll be parented to whatever collider it hits first. You could try playing with the impact layers so it only hits a rig collider.
2. An overlap cast is used to determine if the arrow hit an object so you'll need to adjust the collider size of the arrow to determine how much it sinks in.
3. This sounds related to not running the most recent version - you should be able to follow along with the video exactly.
 
Are you running the latest version of the character controller? A way to verify it is to look at the welcome window and it should show videos/discord links. I'm not able to reproduce some of the items that you are describing and you should be able to follow along with the video precisely.

1. It'll be parented to whatever collider it hits first. You could try playing with the impact layers so it only hits a rig collider.
2. An overlap cast is used to determine if the arrow hit an object so you'll need to adjust the collider size of the arrow to determine how much it sinks in.
3. This sounds related to not running the most recent version - you should be able to follow along with the video exactly.

I do have the videos and discord and I upgraded yesterday. But I had done some of the setup during last week..., like the bow setup. So this could explain. I should better just delete the bow setup, and start from scratch.

Here is what the collider looks like after the character ragdoll has been initiated. Isn't the collider supposed to move around with the character?

1537756939238.png
 
Last edited:
That would case it :)

The base collider does not move with the ragdoll collider since it's the ragdoll doing the movement rather than the actual controller.
 
That would case it :)

The base collider does not move with the ragdoll collider since it's the ragdoll doing the movement rather than the actual controller.

Hmm, so do you think the first arrow will remain on the collider or the rig of the character in 2.0.1 (I am just importing it now, but may need to rebuild a character). If not, is there a way to work around so that all arrows remain on the character's "skin" ?
 
Yes - if you set the arrow to ignore the character layer then it should hit the subcharacter layer which is what the ragdoll uses.
 
Sorry to bump older topics but i'm running into the same issue with arrows stuck on the character layer.
Steps:
Projectile impact layer set to default, and sub character
Shoot arrow
Arrow sticks in character collider
Paused the game to verify arrow clone reparents correctly - it does.
Clone arrow shows impact layers like I forgot to save my changes to the prefab or something :)

I've duplicated in the demo scene with your bow, and arrow prefab by shooting BoxingJoe Dummy in his smug face.

Also, any suggestions to keep the arrows from colliding with each other? If I shoot 5 arrows at the same spot they stack end to end, and if I shoot the stack of arrows my OnObjectImpact event fires. I guess I could check the hitCollider for CrossbowBolt(Clone) and not my CapsuleCollider? Suggestions?
 
Clone arrow shows impact layers like I forgot to save my changes to the prefab or something :)
I'm trying to reproduce this one - can you give more details?

Also, any suggestions to keep the arrows from colliding with each other?
Good thought - at first I thought that you could just change the arrow prefab to the visual effect layer but it doesn't look like the instantiated object keeps that layer. I'll see what changes are needed for this layer to persist.
 
Edit pre fab projectile impact layers to only default and sub character
once you've shot the arrow, go to scene view.
Find the arrow clone you just shot.
Inspect the cloned projectile impact layers.
They don't reflect the prefab impact layers.
 
Last edited:
The impact layers are used from the ShootableWeapon component and not the actual arrow prefab. It's sort of confusing because those options are also available on the Projectile component but aren't used. That is used in cases where the projectile is being used outside of the shootable weapon.

I also looked and things are working properly for the layers - the Projectile Fired Layer allows you to set which layer the projectile gets changed to after firing. If you change that to Visual Effect and deselect Visual Effect from the Impact Layers then it won't detect that layer.
 
Ah, thanks for the explanation! I'll give that a shot. Much appreciated.

Edit:
Works like a charm, and also fixed my stacking arrows. You rock!
 
Last edited:
The impact layers are used from the ShootableWeapon component and not the actual arrow prefab. It's sort of confusing because those options are also available on the Projectile component but aren't used. That is used in cases where the projectile is being used outside of the shootable weapon.

I also looked and things are working properly for the layers - the Projectile Fired Layer allows you to set which layer the projectile gets changed to after firing. If you change that to Visual Effect and deselect Visual Effect from the Impact Layers then it won't detect that layer.
Hi,
I have similar questions.I hope you can help me. Here I have a detailed description and images. The arrow projectiles cannot stick to the arm.

I put the questions together here because I hope others can find answers to similar questions here.
 
Top