Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Input.GetAxis vs Input.GetKey

$
0
0
Hi all,

I have some code that does the following:
- move player around by changing his velocity/position
- when player hits a button, the character stops and targets an enemy
- by default the engine targets the closes enemy instance, but as long as in "targeting mode" the player can chose to move target to a different enemy just by moving "left/right"

They way I do this is first by detecting whether we're in targeting mode or not:
Code (CSharp):
  1. // if SPACE is pressed, enter scoping mode,...
Input.GetAxis vs Input.GetKey

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



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