Giter VIP home page Giter VIP logo

Comments (5)

JLPM22 avatar JLPM22 commented on May 29, 2024 1

Hi!

For the collision with obstacles, it is necessary to modify the SpringCharacterController included for the third-person view character. When updating the trajectories in the SpringCharacterController, this script should handle obstacle avoidance and not create trajectory points inside objects with colliders. For example, this could be implemented with raycasting. I will add an example for this use case in the near future.

For the vertical movements, I will investigate the best way to implement it soon (#5).

I will include all examples as soon as possible!

Thank you!

from motionmatching.

strangeways-dev avatar strangeways-dev commented on May 29, 2024 1

Thank you, I look forward to your implementation.

I will have a play about with it tomorrow and see what I can come up with in the meantime.
If I come up with anything I will share it here for others to use until your implementation is available which I can only assume will be much better than mine.

Thanks again!

from motionmatching.

JLPM22 avatar JLPM22 commented on May 29, 2024 1

Hi!

I've had some time to implement a simple example of how to add verticality + collisions. Please take a look at issue #5 for verticality. Regarding collisions, the same example, JLSceneColliders.unity, showcases how to implement it. As a summary, I created a new CollisionsSpringCharacterController.cs based on SpringCharacterController.cs that uses raycasts to detect whether there is an obstacle between the new position and the previous ones. Predicted and current positions are adjusted never to cross obstacles.

from motionmatching.

strangeways-dev avatar strangeways-dev commented on May 29, 2024

This is awesome, I can see how he snaps to the floor when he walks off the edge of the ramp though.

Making the Joe object have a Capsule Collider and a Rigidbody and making the SpringCharacterController use the Rigidbody instead of just moving the transform of Joe would be a good start in fixing this but I can see a few issues already that need to be resolved to make this possible. I would make the SpringCharacterController and MotionMatching objects both children of Joe and instead of using their transforms for the target positions I would create new Vector3 variables to use instead because the way it's coded if you make them children of Joe then when Joe moves they move and he would never reach his target.

Also the feet are away from the floor on slopes but I already have a solution for this. I've been working on a character system and I use the Unity Animation Rigging package to use IK on the feet to make them stick to the floor but that's half the problem because the collider also needs to be dynamic changing height and scale to allow one foot to be raised etc., which I calculate from the height distance between the two desired feet positions which are determined by Raycasting down from above where the feet should be before IK is applied. I have already coded this in another project I just need to integrate it in to this.

I will be able to do this, only the first problem will be tricky for me because I haven't fully wrapped my head around how your system works yet but I'm getting close to understanding.

I will make a Pull Request when I've finished for you to take a look at.

from motionmatching.

JLPM22 avatar JLPM22 commented on May 29, 2024

Apologies for the delayed response. This is excellent feedback! You're right about the collider and rigidbody changes. I'm interested in learning more about your solution, and I'd be happy to review your pull request when it's ready. Let me know if I can clarify any parts of the system.

from motionmatching.

Related Issues (6)

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.