Answer the question
In order to leave comments, you need to log in
How to make water in Unity3D?
the problem is this, I'm making a 3D game and I need to make water physics, well, in order for the character to swim, at the moment I use the OnTriggerEnter and OnTriggerExit methods in the middle of the OnTriggerEnter method is if (other.tag == "Water")
{
isSwimming = true;
rb.useGravity = false;
}
and in OnTriggerExit is if (other.tag == "Water")
{
isSwimming = false;
rb.useGravity = true;
}
then I check in Update(): if (Input.GetKey (KeyCode.Space) && isSwimming)
{
transform.Translate (0, SwimmingForse * Time.deltaTime 0)
}
and the following bugs appear that need to be fixed, when I surfaced, it moves me back into the water waist-deep, while the speed is maintained and I am pulled to the bottom
. -some oblique surface I'm flying to the side. I realized that using gravity off is a bad idea, tell me how best to do it
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question