Skip to main content
6 events
when toggle format what by license comment
Dec 12, 2024 at 22:11 comment added Kevin You haven't provided enough context for us to tell what is wrong. For example, what is the data structure with fields jumpForce and gravity? What is the component that player references?
Nov 29, 2024 at 16:08 comment added Achie1 It is the standard character controller provided by Unity.
Nov 29, 2024 at 14:55 comment added Philipp What exactly is the CController in the first script? Is that a reference to the standard CharacterController provided by Unity or something else?
Nov 29, 2024 at 13:19 comment added DMGregory A few minor notes on code clarity: here you're assigning jumpForce directly to velocityY, not applying it as a force. So I'd recommend naming that variable jumpSpeed instead, to communicate it's a speed measured in metres per second, not a force measured in Newtons. Similarly, pos is being passed into SetVelocity(), so it's really a velocity or vel, not a "position" as its current naming implies. Renaming the variables won't solve this problem, but it makes the code easier to reason about and makes it less tempting to introduce errors down the line with false assumptions.
Nov 28, 2024 at 21:14 history edited DMGregory CC BY-SA 4.0
This is C#, not the deprecated language UnityScript. Be sure to read tag info when tagging your questions.
Nov 28, 2024 at 20:05 history asked Achie1 CC BY-SA 4.0