How to change root component of ACharacter?
The object inherited through: ACharacter (C++) -> AMyObject (C++) -> AMyObject_BP (Blueprint)
I want to change root component from CapsuleComponent to BoxComponent. My character is a flying vehicle. What can I do with it?
I tried next variants:
1. Change RootComonent in C++ from UCapsuleComponent to UBoxComponent in constructor.
Result: failed, implicit errors after launch editor and crash). (BoxComponent is UPROPERTY)
2. Set the capsule component sizes to minimal and create the new collision object in component list.
Result: failed, new collision objects not responds collision (collision is setted up, physics, etc...) and vehicle overlaps the all.
Help please :)
CharacterMovementComponent currently only accepts vertical capsules as the collision component.
The issue with boxes is that rotation is tricky, since corners may pass through objects between the start and end locations, since sweeps only support initial and end rotations, not sweeps through changes in rotation.
You may be able to extend the CharacterMovementComponent code to sweep something other than a capsule (possibly override MoveUpdatedComponent()) and modify the hit results as a result, but I think you'll still have issues with rotation since we don't check collision when rotation changes (not necessary for vertical capsule).
... this is the information I have on this subject. I know they were considering new shapes in a future release, but I haven't heard when that would be.
If for some reason you still want to change a hierarchy of a character you can do the following in your derived class constructor:
answered Oct 05 '18 at 04:23 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here