The arrow projectile cannot stick to the arms.

wuyan

Member
I recently started learning and using UCC. I have some questions about bows and arrows. I hope I can get help here. Thanks!

1.The arrows can stick to the head, chest and legs of the AI. But the arrow cannot stick to the forearm successfully.I insert debugging code in "Destructible:OnCollision".The arrow correctly collides with the forearm, and the layer of the forearm is subcharacter.
And, the same problem also happens on water.
1596639908815.png

2. In addition, I found that if I set the water layer to water, I couldn't trigger the FootstepOnWater effect. If the water layer is set to default, this effect can be triggered correctly.

3.If I choose "Fire In Look Source Direction" when I shoot. Archery animation can't match the shooting direction very well. This doesn't look realistic. And will deviate from the crosshairs when shooting close targets.
On the contrary, if I choose to shoot in the direction of the bow, The player cannot aim by using crosshairs. And the real target is not in the center of the screen. What are the best solutions to this problem?
1596642368923.png

4,Finally, I added one character IK state for bow to make it look more realistic when aiming and shooting. But I just want to use this state when aiming or shooting. I don't want the player to be so exaggerated when he looks around Just because he had a bow in his hand.What should I do? Who can give me a direction?
1596644075460.png

My English is not good, I hope I have expressed clearly.Thanks!
 
I found a little clue to the first question.

This problem occurs if I don't scale an object(box, plane, tree, hips of the character, etc.) in proportion to the three axes. For example, scale (2,2,2) is OK, and scale (2,3,2) will have this problem when the arrow hits it. I used a plane as water, and I set the scale of this plane to (4,1,4), and this problem occurred. Now I set it to (4, 4, 4) and the problem don't occurred. Similarly, I set the scale of org-forearm. L from default to (1,1,1), this problem will be solved.
1596675845063.png

Can anyone tell me why?

In addition, the rest of the problems are still unclear.
 
For the scaling issue take a look at the decal section of the Surface System page. The same situation applies for projectiles that stick.

1. If you don't want the arrow to stick to the character's capsule collider you should be able to deselect Character from the collision mask.

2. The Character Foot Effects will ignore any layers specified by the CharacterLayerManager.IgnoreInvisibleWaterLayers mask. I can look at making this more extendable so you can specify your own layers.

3. With a third person perspective there is always some deviation between the crosshairs and the look direction. This is because the crosshairs isn't always in the center of the screen with a straight angle like it is with a first person perspective. In order to fix this you may need to get some animations that match up better with the look direction of the crosshairs.

4. You can use the state system to change values at runtime. Take a look at this page: https://opsive.com/support/documentation/ultimate-character-controller/state-system/
 
Hi Justin,Thank you so much!

2. The Character Foot Effects will ignore any layers specified by the CharacterLayerManager.IgnoreInvisibleWaterLayers mask. I can look at making this more extendable so you can specify your own layers.
That's true, and it was validated when I modified the code you said. I'm looking forward to your update! Also, if I want to trigger the wave effect when the character walks in deep water. Is there a good way to do it?

4. You can use the state system to change values at runtime. Take a look at this page: https://opsive.com/support/documentation/ultimate-character-controller/state-system/
According to the way you say. I seem to have found a way. When I aim or shoot, StateManager.SetState(m_Character, "BowState", true);. If not, StateManager.SetState(m_Character, "BowState", fase);. Do you mean that? :)
 
According to the way you say. I seem to have found a way. When I aim or shoot, StateManager.SetState(m_Character, "BowState", true);. If not, StateManager.SetState(m_Character, "BowState", fase);. Do you mean that? :)

You could just use the Use ability's state ("Use" in the demo) and have your IK preset only active during that state. (If you don't want this state to be active when other items are used, then you'll have to set up some logic involving blocking a preset.)
 
Top