How to disable mantling for certain actor? Preferably through tags or collision preset #228
-
How to disable mantling for certain actor like a barrel? i have a barrel that is destructible. I want it to be an object that can’t be climbed/mantled on. How do i stop mantling it when i press jump or fall close to it in its direction ? i want to disable mantling for certain actors which other wise are mantleable by default i tried messing around with mantleComponent c++ file but failed to get it right. I mostly eould like it to check for collision type and if it is of type “NoMantle” (i made this collision preset up) the mantle will cancel |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Collision settingshttps://github.com/dyanikoglu/ALS-Community/blob/81014e87b8767cd43512e9ba56920245413f5e09/Source/ALSV4_CPP/Public/Components/ALSMantleComponent.h#L85-L88 You can see from the code above that the mantle system use the profile "IgnoreOnlyPawn" to detect a mantleable object. If you made a custom collision object channel "NoMantle", you can set the IgnoreOnlyPawn Preset to ignore the objects from the NoMantle object channel as well (in the Engine - Collision category found in the project settings) Alternatively - the "tags" way:To disable mantling via tags, you can add the following code to the ALSMantleComponent.cpp, right under the code pasted above UPrimitiveComponent* HitComponent = HitResult.GetComponent();
if (HitComponent)
{
if (HitComponent->ComponentHasTag("NoMantle"))
return false;
} Then, in the editor, select the object you want to be non mantleable and add the Component Tag "NoMantle" in the Details panel of this object. |
Beta Was this translation helpful? Give feedback.
Collision settings
https://github.com/dyanikoglu/ALS-Community/blob/81014e87b8767cd43512e9ba56920245413f5e09/Source/ALSV4_CPP/Public/Components/ALSMantleComponent.h#L85-L88
https://github.com/dyanikoglu/ALS-Community/blob/81014e87b8767cd43512e9ba56920245413f5e09/Source/ALSV4_CPP/Private/Components/ALSMantleComponent.cpp#L181-L182
You can see from the code above that the mantle system use the profile "IgnoreOnlyPawn" to detect a mantleable object.
If you made a custom collision object channel "NoMantle", you can set the IgnoreOnlyPawn Preset to ignore the objects from the NoMantle object channel as well (in the Engine - Collision category found in the project settings)
It will work because…