blueprint
GASP > CBP_SandboxCharacter (Modified to support crawling/prone)
- Exposure: public
- UE Version: 5.6
EventGraph Changes
- Edit
E_Stanceenum to add "Crawl" stance. - Edit
E_Gaitenum to add "Sneak" and "Crawl" speeds. - Rename the variable "
Stance" to "CurrentStance".- Replicates: RepNotify
- Add variable "
PreviousStance" [E_Stance]- Replicates: Replicated
- Add variables to track Sneak and Crawl speeds [Vector].
SneakSpeeds[Vector=225.0,200.0,180.0]CrawlSpeeds[Vector=150.0,50.0,120.0]
- Add variables to track desired capsule half-heights for each stance [Float].
HalfHeight_Stand[Float=78.0]HalfHeight_Crouch[Float=58.0]HalfHeight_Crawl[Float=30.0]
- Add other variables...
IsWalkingOffLedge[Boolean]
- Add custom events to EventGraph:
ChangeStance_Server- Replicates: Run on Server [Reliable]
New/Changed CBP_SandboxCharacter Functions
- [f] TrySetStanceTo - https://blueprintue.com/blueprint/-6u18g4q/
- [f] CanChangeStanceTo - https://blueprintue.com/blueprint/2ixal_65/
- [f] ApplyStanceSettings - https://blueprintue.com/blueprint/le0dqf25/
- [f] TraverseStandOrJump - https://blueprintue.com/blueprint/nuqbm4y_/
- [f] IsStanceHigh - https://blueprintue.com/blueprint/0uyg6pr1/
- [f] GetHalfHeightOfStance - https://blueprintue.com/blueprint/_fqntlct/
- [f] GetStanceDelta - https://blueprintue.com/blueprint/rsvjj9c5/
- [f] GetDesiredGait (modified from GASP original) - https://blueprintue.com/blueprint/m-85es1q/
Additional Changes
- You also need to modify
ABP_SandboxCharacter > Update_Statesto replaceisCrouchedwith a check againstSandboxCharaceter.CurrentStance( for the modified blueprint, see https://blueprintue.com/blueprint/hhpe7mp_/ ). - You need to find crawling animations (which are not included in GASP) then retarget them to the UEFN skeleton, and create new entries in the SelectionDatabase. Adding animations is not covered here.
Notes on Replication
- Stance changes need to be handled on the server, so call our
ChangeStance_Serverevent and have that handle the validation logic and set the CurrentStance state. - The CurrentStance and PreviousStance variables replicate so that all clients are aware of stance states.
- CurrentStance needs a RepNotify so that clients can change animation/visual state of the other characters with
ApplyStanceSettings. For local clients, this is called immediately.
ctrl + v