Coder Social home page Coder Social logo

Bug? about gold-player HOT 19 CLOSED

hertzole avatar hertzole commented on May 30, 2024
Bug?

from gold-player.

Comments (19)

Hertzole avatar Hertzole commented on May 30, 2024

Hello!
I'm not interely sure what you mean. Do you think you could send me a project where you can reproduce this or record the problem? That way I can get a much easier understanding of what's going on. :)

from gold-player.

mwg3 avatar mwg3 commented on May 30, 2024

Project is really big cause he has a lot of objects. Ok i will try to explain my problem. When i press jump button my player doesn't want to jump? This looks like it's blocking in invisible wall. Really weird.

from gold-player.

Hertzole avatar Hertzole commented on May 30, 2024

I can think of two possible reasons.

  1. The ground layer on the player (Movement - Other - Ground Layer) is not set up properly. Make sure to put the player on it's own layer and then NOT include that layer in the Ground Layer.
  2. The character controller height and center don't match. The character controller Y center must half of the character controller height. So for example, if the height is 2, the Y center needs to be 1. If the height is 1.8, the Y center needs to be 0.9. This is due to how the ground check and crouch checking work.

Let me know if this fixes your problem! If not, I would really like to see a screenshot of your player inspector so I can see if there are any anomalies. :)

from gold-player.

mwg3 avatar mwg3 commented on May 30, 2024

Only the first jump works well

from gold-player.

Hertzole avatar Hertzole commented on May 30, 2024

As I said, a screenshot of your inspector (with the movement tab selected) or a video of the problem would be greatly appreciated! It helps me a lot to see what the problem could be. :)

from gold-player.

mwg3 avatar mwg3 commented on May 30, 2024

Sure.
https://imgur.com/Hsjoapo
https://imgur.com/BAXglps
https://imgur.com/aEL7Ysk

from gold-player.

mwg3 avatar mwg3 commented on May 30, 2024

And player layer
https://imgur.com/XrO6Y2O

from gold-player.

mwg3 avatar mwg3 commented on May 30, 2024

Others settings are default

from gold-player.

Hertzole avatar Hertzole commented on May 30, 2024

In the first picture, I suspect that is the Ground Layer. You need to put every layer there you want to collide with EXCEPT for the player layer. So if your world is generally built up by objects with the Default, Floor, HitBox, etc layer, make sure to add those in the Ground Layer. But exclude the Character layer from that.
I hope that helps! :)

from gold-player.

Hertzole avatar Hertzole commented on May 30, 2024

I also discovered a bug with the crouching (see #24) that might be related to your problem with the player being in the ground when crouching. I'll make sure to fix that ASAP and then I can help you patch it until the next release, which will take a while!

from gold-player.

Hertzole avatar Hertzole commented on May 30, 2024

Sorry for the semi spam. Just wanted to let you know how to quickly patch the player controller in case you have problem with the crouching.

  1. Open the PlayerMovement script (Hertzole/Gold Player/Scripts/Core/Modules/PlayerMovement)
  2. Change line 256 from
    m_CrouchCameraPosition = PlayerController.Camera.CameraHead.localPosition.y - m_CrouchHeight;
    to
    m_CrouchCameraPosition = PlayerController.Camera.CameraHead.localPosition.y - (CharacterController.height - m_CrouchHeight);
    (Can also be seen here)

I hope things work out for you! If not, just ask away! :)

from gold-player.

mwg3 avatar mwg3 commented on May 30, 2024

Hi, thanks for help Hertzole! You're so helpful and i will add information about you in my project!
My problem was with rigidbody when "Use gravity" function was on.
But i have 2 others problem :/
Your script doesn't have a camera collider and that is problem for me :/
And secondly..how to add knockback functions when player got damage?

from gold-player.

Hertzole avatar Hertzole commented on May 30, 2024

Hello!
Gold Player unfortunately does not support rigidbodies, so some funky behaviour could occur with that. Glad you figured that out! :)
I'm not sure what you mean with camera collider. Could you elaborate?
Currently there's no support for knockback, but I could probably add that in the next release. I will look into it. Meanwhile, you could try to make a seperate script to apply knockback, like the example I found here. I hope that helps! :)

from gold-player.

mwg3 avatar mwg3 commented on May 30, 2024

Maybe script like 'rb.AddForce(target.transform.forward * Distance, ForceMode.Impulse);' will work with ur player movement script?

from gold-player.

Hertzole avatar Hertzole commented on May 30, 2024

Right now I doubt it will work. But I'll do my best to add a easy to use knockback system.

from gold-player.

mwg3 avatar mwg3 commented on May 30, 2024

Hi brother. I have one mistake and one sugestion. Bug with camera collision https://imgur.com/a/Ek2hJIl
And will be awesome if you add on this project Falling damage :)
Thanks a lot for good project!

from gold-player.

Hertzole avatar Hertzole commented on May 30, 2024

Hello!
For the camera collision problem, you need to change the near clipping planes on your camera, like this. I usually set it to 0.01. By default, it's 0.3, which can cause this issue.
For fall damage, that should already be possible to do in your own scripts using Gold Player. Here a brief summary of how you could do it:
In your scripts, like a health script, subscribe to the OnLand event in GoldPlayerController.Movement. If you aren't familiar with C# events, Unity has a good tutorial on it here. Then in your land callback, you can check if the fallHeight is more than your threshold and do damage if the fall height is far enough.

I hope that helps! :)

from gold-player.

mwg3 avatar mwg3 commented on May 30, 2024

Thank you so much! You're the most helpful guy I've ever seen :-)

from gold-player.

Hertzole avatar Hertzole commented on May 30, 2024

Thank you! I try my best! :D

I will close this issue now as it seems like it's been resolved. If you have anything else you want to bring up, just comment again or open a new issue.

Remember to keep an eye out for new updates that will (hopefully!) include knockback and other fixes! :)

from gold-player.

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.