Quantcast
Channel: Questions in topic: "addforce"
Viewing all articles
Browse latest Browse all 1264

Jump Force gets added up with repeated input and causes character to fly off

$
0
0
I've created a game where objects(set as prefabs) spawn beneath the player. In order to make sure tat they spawn beneath the player and not mess up the player or the platform by merging with them I decided to make the character jump whenever the spawn is triggered, for that I have used: `GetComponent().AddRelativeForce(Vector3.up * jumpForce); ` But whenever there is a repeated touch the Player goes higher than normal since the force gets added up twice, I do not want it to do so. How would that be possible? Examples with code would be very appreciated :^)

Viewing all articles
Browse latest Browse all 1264

Trending Articles



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