Coder Social home page Coder Social logo

Comments (9)

ciro-unity avatar ciro-unity commented on May 2, 2024 1

Thanks everyone for chiming in. I have asked the 3d modeler to remove the keys from the model's root, she provided me with new models which will soon be integrated on main and art-assets, which should fix this issue.

from open-project-1.

mtakac avatar mtakac commented on May 2, 2024

It seems like the issue is caused by animations. If I disable Animator component on the PigChef prefab the SpawnSystem spawns player at the correct position.

from open-project-1.

mtakac avatar mtakac commented on May 2, 2024

One more observation: it seems like enabling the Apply Root Motion option in Animator component panel on PigChef prefab fixed the issue and didn't break the animations. I am not really sure why or if this a good fix. Let me know, I am happy to open a PR if this solution is good enough.

from open-project-1.

ciro-unity avatar ciro-unity commented on May 2, 2024

Sounds like an interesting thing that we definitely need to fix, but also understand why it happens and how can we prevent it.
I know that some animation clips have keyframes on position and rotation for the root, which generally I'd like to avoid.

Also a little heads-up. There's a setting in the Animator which can feel quite mystical :D called "Write Defaults". A short explanation.

Having it on/off can change a lot how a state machine behaves. It's all logical, but you need to be aware of its value (and each state can have a different value for it).

Let me know if it's not clear, I'll re-explain :)

And no PR needed for now, but I'll keep the issue open. Thanks a lot for it, @mtakac !!

from open-project-1.

mtakac avatar mtakac commented on May 2, 2024

Thanks for the explanation @ciro-unity. I didn't know about Write Defaults option. Sounds like it could come handy to be aware of it.

However I don't think this is related to this exact issue. If I understood correctly, Write Defaults option is relevant when destroying and the re-instantiating animated object, but that doesn't seem to be the case here. Also I verified that toggling it on various animation clips doesn't fix the issue, but I think you're right about the problem being in animations setting the position:

Screenshot 2020-11-19 at 03 02 20

Unfortunately, I don't know enough about 3D animations in Unity to do anything about it, but would be interesting to see what happens if somebody updates animations to remove the position.

from open-project-1.

Wodopo avatar Wodopo commented on May 2, 2024

While checking Apply Root Motion allows the character to spawn at the desired location and walk around it's not without problems.

Changing settings on the Animator controller while playing, and with the Apply Root Motion off gets the desired behaviour, but entering Play Mode with the same settings gets a different, undesired, behaviour.

A video to demonstrate: https://youtu.be/DDoaKjf54KI

from open-project-1.

jandd661 avatar jandd661 commented on May 2, 2024

Greetings, I'm new to the project. After looking things over I noticed the animation(s) "keyframe" the position of the character. Removing the position keyframes from the animations (by duplicating them, then removing the position attribute, then retargeting the animator) has resolved this issue in my testing.

I am reluctant to call this a fix as I don't know what the big picture is for the animations. Currently, the animations are baked into the model and that is not my area of expertise.

from open-project-1.

ErikBehar avatar ErikBehar commented on May 2, 2024

this issue can be closed now

from open-project-1.

ciro-unity avatar ciro-unity commented on May 2, 2024

Thanks! And yes, we implemented the fix as described by @jandd661

from open-project-1.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.