Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- Root Motion WIP [RESOLVED] #799

Merged
merged 5 commits into from
Feb 10, 2024
Merged

Conversation

Almahmudrony
Copy link
Contributor

  • Root Motion For WI
    Its not the best solution(Kinda Hacky) but it will work for general purpose.
    If someone is very good at math please contact me([email protected])

  • Rules to follow for perfect Root Motion Implementation
    Root bone must be point upward(Like a default bone in Blender).
    Root boot should touch the ground always.
    When animating Character Root bone ROTATION can only be animated in UP axis(Ex. In Blender its Z Axis rotation).
    When animating Character Root bone POSITION can be animated for XYZ, No problem.

  • Application in Engine.
    Enable RootMotion in AnimationComponent property window.
    Set the RootBone(name should be same as you name in your desired 3D modelling software)
    Attach a script component to AnimationComponent.
    Do not rotate character(in which you will apply root deltas from LUA) other than Y Axis,
    [Example: Lua Code]

	local root_translation = animation_comp.GetRootTranslation()
	character_transform.Translate(root_translation)
	
	
	local root_rotation = animation_comp.GetRootRotation()
	character_transform.RotateQuaternion(root_rotation)

[ExampleProject: https://drive.google.com/file/d/12RkdRpw61AEEGzKy9VhtLlFU0EWWwVcR/view?usp=sharing ]

[Beast Character Copyright - Frictional games(Amnesia The Bunker.)]
https://frictionalgames.com/general-faq/#mod-monetisation

@brakhane
Copy link
Collaborator

JFYI, you don't need to open a new PR for changes, you can just push to the same branch you made your PR from and the original one would get updated automatically.

@Almahmudrony
Copy link
Contributor Author

Thank you. For letting me know. I have learned it now.

Copy link
Owner

@turanszkij turanszkij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good now, only minor issue I saw is that you copy the argument vector in

static bool EntityExistsInList(Entity entity, std::vector<Entity> entityList)

instead of passing by reference, and anim window is doesn't fit all elements without a scrollbar, but I'll fix these in the next commit.
Thanks for your work.

@turanszkij turanszkij merged commit 77e7edd into turanszkij:master Feb 10, 2024
3 checks passed
@Almahmudrony
Copy link
Contributor Author

Almahmudrony commented Feb 10, 2024

Thank you.
It was an honor to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants