Quantcast
Channel: Answers by "Vandarthul"
Viewing all articles
Browse latest Browse all 86

Answer by Vandarthul

$
0
0
You can use Physics.Linecast or Raycast to control if you are touching the ground or not. You can check the unity's 2D tutorial and get the idea of using Linecast. There is a script written in that tutorial exactly what you want. http://pastebin.com/JS3Ktbgp Here is a script that I wrote long time ago that suits your needs + it has double jump too, **but be aware of that this is for 3D, you might need to convert it for 2D**(Rigidbody2D instead of Rigidbody for example). Also, that this script is old and I wasn't aware of many things back then. But still, you can comb out the areas that you need and/or you can get the idea behind it.

Viewing all articles
Browse latest Browse all 86

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>