Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
Sign in to follow this  
Gecko

Swimming system?

Question

i am making a new survival game and i was going to add swimming to the game i can not find a good tut and i need help to get this down can anyone help me ?

 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

You should definitely take a look at the BurgZergArcade Hack and Slash swimming tut. It is also a movement script, but basically here is the jist:

- Have a boolean that states if IsSwimming = true then you cannot run or jump (putting your jump and run function in an if statement checking if IsSwimming is false then you can run or jump, else you cannot)

- Set the gravity to 0 so you don't sink (if IsSwimming = true)

- Have a collider on your water (remember to check IsTrigger) then you can use OnTriggerEnter and Exit to send a message to enable IsSwimming.

- Use an animation if you wish (but remember to set wrapmode to loop)

  • Like 1

Share this post


Link to post
Share on other sites

  • 0
Please login or register to see this quote.

Thank you man will try when i get home

Share this post


Link to post
Share on other sites
  • 0

multikill@ thats what i am looking for ma game.

big thanks +1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...