Cannot setup Hang Ability state

Hamesh

Member
I am trying to add the hang ability to Nolan in the UCC demo scene. I have managed to replicate everything except the adding of the state AdjustPullUpCastDistanceHangPreset. For some reason when I try to add this I get the following error:

Error: Unable to add preset AdjustPullUpCastDistanceHangPreset - the preset doesn't use the same object type.

I can't find any other preset with this name,so what exactly am I doing wrong?
 

Attachments

  • Screenshot - 16 02 2020 (5).png
    Screenshot - 16 02 2020 (5).png
    15.9 KB · Views: 6
Are you adding AdjustPullUpCastDistanceHangPreset to the Hang ability, and not some other object?
 
It's the one in the preset folder, I clicked on it in the demo Nolan's hang ability so that it took me to the folder. Is there another preset with this name?
 
The actual preset is fine - you'll get that error if you try to add it to another object besides the Hang ability. For example, if you try to add the Hang preset to the Vault ability.
 
Hmm, here are the steps I have taken:

1) Added Hang Ability to UCC demo Nolan
2) With the Hang Ability selected, under States by default there is only Airborne and Hang (top to bottom)
3) So I click on the little plus and choose Add Existing Preset
4) I select AdjustPullUpCastDistanceHangPreset
4) I get the error above

Screenshot - 18 02 2020 (2).pngScreenshot - 18 02 2020.png
 
What if you create a new preset? What type does that have? Your left screenshot doesn't have the object that you are adding the state to visible so I can't verify that you are adding it to the correct location.
 
Sorry, it is a very long component. I have taken a few more screenshots from the top, let me know if that is what you need. I did also try to create a new preset but I get asked if I want to replace the existing one, which I wouldn't think I would want to do, and if I create a blank one then it will be blank which is not what I need?

Screenshot - 19 02 2020.pngScreenshot - 19 02 2020 (2).pngScreenshot - 19 02 2020 (3).png
 
It does look like you are adding it to the correct position. Do you get the same error within the demo scene? By adding a new preset it shouldn't be replacing anything - it'll just create a new file that is empty.
 
Yes tried it in the UCC demo and the Agility demo and unfortunately same error. I tried to create a new preset call "test" but as soon as I added the AdjustPullUpCastDistanceHangPreset to it the error happened. I will try to reimport just this preset and see if that fixes things. Any other suggestions? I am using 2019.3 if that helps.
 
The AdjustPullUpCastDistanceHangePreset only has one property adjustment so if your test preset was added correctly then you could just add that property to the test preset. In the next version I'll add more logging so you can see the type of preset that is being added.
 
Tried reimport and also didn't work, I even tried adding a few other presets and also same error, very strange.

With the test preset, so even with a different name the preset will still work the same as long as it has the same property?
 
The actual preset file name doesn't matter - just make sure the state name is correct (AdjustPullUpCastDistance).

I was looking closer into this and it does look like there was a problem though. If you switch the inspector into debug mode you'll be able to see the object type that it is trying to assign. I had renamed the AddOns namespace and this preset is still using the old name. You can manually change the name to Opsive.UltimateCharacterController.AddOns.Agility.Hang, or use the attached file.

1582124497327.png

Thanks for letting me know - I'll go through the other types to make sure it's correct.
 

Attachments

  • AdjustPullUpCastDistanceHangPreset.asset
    632 bytes · Views: 4
Yes that was it, thank you for working through it with me. I renamed it and the error is gone, I thought I was going crazy for a minute there :giggle:

I'm having one other small issue but I'm not sure how easy it will be to pin point the reason. When standing under the hang object in a copy of the demo and pressing "Jump" Nolan decides to jump through the wall under the hang object and then fall into the infinity Unity abyss. I couldn't replicate this in the default demo, but I am wondering if it could be a simple case of the order of the states or something simply like that?
 
When your character is hanging is their capsule collider through the wall in front of them? This would cause the collisions not to be detected correctly when jumping off of the hang. In that case you can either make the capsule collider radius smaller, or have the character hang further away from the wall.
 
Ah sorry I worked it out, it was just a few settings in the Vault ability that weren't set correctly, so the ability was trying to vault over pretty much everything. All good now thank you.
 
Hi again Justin, is there anything specific I need to do to get the climb up working from one hang object to another? I have gone through the ability properties side by side and mine look exactly like the ones in the demo, yet when I press the up arrow/W in my copy of the demo seen Nolan doesn't climb to the higher hang object. If I start at the top climbing down works fine in the same spot. It is like I haven't specified the input for this or something. I noticed that there is a "Move Up Button Name" property, but this is left blank in the original demo scene.
 
You'll likely need to adjust some offsets in order to get it to work for your scene. Take a look at these pages:

 
I am actually using literally a copy of the agility demo room, I have just moved it into the UCC demo scene. What is strange is that when starting at the top I can climb downwards through the hang objects but I cannot go up. Is there any particular way I could try to debug the issue?
 
Yes - you can place a breakpoint within DetermineNextHangObject to see where it is ending early when you try to TransferUp
 
Top