Closed mwg3 closed 5 years ago
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. :)
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.
I can think of two possible reasons.
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. :)
Only the first jump works well
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. :)
And player layer https://imgur.com/XrO6Y2O
Others settings are default
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! :)
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!
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.
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! :)
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?
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! :)
Maybe script like 'rb.AddForce(target.transform.forward * Distance, ForceMode.Impulse);' will work with ur player movement script?
Right now I doubt it will work. But I'll do my best to add a easy to use knockback system.
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!
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! :)
Thank you so much! You're the most helpful guy I've ever seen :-)
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! :)
Hi, thanks for really good movement script. But i have two problems When my player want to jump he hits the roof? and when im trying crouch he's under the world... Could you help me? Thanks a lot!