'Swimming' system

What do you want to achieve?

I have put together a 3d ocean and some stuff supporting the interactivity (i.e:splashes,camera effects once under the waves) and i want the player to smoothly transition from walking to swimming when walking into the water

451f017df3d7e03059a6146cb3a323b4

What is the issue?

I cannot find/come up with a way to do this transition.

What solutions have you tried so far?

ive gone through youTube tutorials and several devForum posts on this topic, but most of them were either unreliable or buggy.

ive spent a good part of my day on this and am completely stuck, which is why I’m reaching out for help.

Might be able to help, depending on what you want. Just want to ask a few things.

  • How would you ideally want to transition into it? (It is a sequence of animations that depend on their depth, or what?)
  • What are the waves made of? (How exactly is it made, through a larger part or several parts combined?) (and If it’s a uniform height this wouldn’t be too difficult)
  • How do you currently handle the water effects for the camera? (Is it using some built in method, like humanoid states, or is it through another check?)

Transition from a normal state into a state of which the player would be sent into the swimming state, more specifically the player would persist floating at a Y value.

I’m going to state now that i do know this Y value.

An editable mesh.

:RaycastLocal() is used for the camera effects. basically just a raycast that can check for each triangle for better accuracy.

Just to be clear, you’re only looking for a way to get the Ground -> Swim and vice versa event, or are you also looking for a way to make them float once they’re in this state?

If it’s just the transition you really care about, I could post a skeleton script I made that might be what you’re looking for.

Just to float, I’ve already stuffed together a thing for the transition, although it is a little rough.

I’ve ended up going back to my old code and figured out i used the wrong value and the wrong instance.

:O)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.