I’ve been making my own version of the ACharacter and UCharacterMovementComponent classes by pasting contents and changing variable names. At some point I started suffering with the above linker error, which I’ve found other people have stumbled across in this post: here
The problem was related to the use of the FRootMotionMovementParams structure in my copied code (i.e. commenting it out, removed the issue). Looking at the declaration in AnimationAsset.h, I suspect that an insertion of the ENGINE_API macro may solve the issue for me, but I don’t want to change the source code.
Fortunately, root motion isn’t crucial for my project, but it would be nice if this could be rectified so that I easily had the option in future.
Can you explain what code you were copying and where you ran into the linker error? Depending on the code being copied/used this seems to be expected behavior. RootMotion is not included by default in order to improve overall compile times, and can be included as necessary. Additionally, if the code being copied contains Editor-Only code, this will cause the project to be unable to package as well. Because of this, it may be best to extend the Character & CharacterMovementComponent classes with the functionality you need for your project rather than trying to copy/recreate them.
(Note, the function called on the FRootMotionMovementParams structure is almost arbitrary, but needs to be a function that involves RootMotionScale somehow. For example, Clear() doesn’t cause a problem, while the above mentioned function and Accumulate both do (plus likely more)).
have reproduced this issue and logged a report for it here Unreal Engine Issues and Bug Tracker (UE-40452) . You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.
Unfortunately it won’t be possible to get this fix included in time for the 4.15 release, however I have added a note to the original report to indicate the ENGINE_API fix as well as suggest including a fix for this issue in a hotfix.