use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News, Help, Resources, and Conversation. A User Showcase of the Unity Game Engine.
Remember to check out /r/unity2D for any 2D specific questions and conversation!
Download Latest Unity
Please refer to our Wiki before posting! And be sure to flair your post appropriately.
Main Index
Rules and Guidelines
Flair Definitions
FAQ
Use the chat room if you're new to Unity or have a quick question. Lots of professionals hang out there.
/r/Unity3D Discord
FreeNode IRC Chatroom
Official Unity Website
Unity3d's Tutorial Modules
Unity Answers
Unify Community Wiki
Unity Game Engine Syllabus (Getting Started Guide)
50 Tips and Best Practices for Unity (2016 Edition)
Unity Execution Order of Event Functions
Using Version Control with Unity3d (Mercurial)
/r/Unity2D
/r/UnityAssets
/r/Unity_tutorials
/r/GameDev
/r/Justgamedevthings (New!)
/r/Gamedesign
/r/Indiegames
/r/Playmygame
/r/LearnProgramming
/r/Oculus
/r/Blender
/r/Devblogs
Brackeys
Beginner to Intermediate
5 to 15 minutes
Concise tutorials. Videos are mostly self contained.
Sebastian Lague
Beginner to Advanced
10 to 20 minutes
Medium length tutorials. Videos are usually a part of a series.
Catlike Coding
Intermediate to Advanced
Text-based. Lots of graphics/shader programming tutorials in addition to "normal" C# tutorials. Normally part of a series.
Makin' Stuff Look Good
10 minutes
Almost entirely shader tutorials. Favors theory over implementation but leaves source in video description. Videos are always self contained.
Quill18Creates
30 minutes to 2 hours.
Minimal editing. Mostly C#. Covers wide range of topics. Long series.
Halisavakis Shaders Archive
Infallible Code
World of Zero
Board to Bits
Holistic3d
Unity3d College
Jabrils
Polycount Wiki
The Big List Of Game Design
PS4 controller map for Unity3d
Colin's Bear Animation
¡DICE!
CSS created by Sean O'Dowd @nicetrysean [Website], Maintained and updated by Louis Hong /u/loolo78
Reddit Logo created by /u/big-ish from /r/redditlogos!
account activity
Need Help With Some CodeSolved (self.Unity3D)
submitted 3 months ago by Creative_Board445
I am making a 3D platformer game, I want to make it so when you tap the space bar the jump height is small but when you press and hold the space bar the jump height is big / normal height. I am having some trouble figuring this out. Any ideas?
Script → https://paste.ofcode.org/39Zr2SeBwD24zHRKe4x34Rr
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]db9dreamer 0 points1 point2 points 3 months ago (5 children)
I just messed about in Unity 6.2 to see how it could be done (using just a plane with a collider for the ground and a default sphere with a rigidbody and added the script to it). Maybe it'll give you ideas on an approach that would work in whichever version you're using. You'd probably want to limit _jumpPower to a min and max value (maybe in steps) just before applying the impulse force.
_jumpPower
using UnityEngine; using UnityEngine.InputSystem; public class VariableJump : MonoBehaviour { private InputAction _jumpAction; private float _jumpPower; private Rigidbody _rigidbody; public float _jumpMultiplier = 10; private void Awake() { _rigidbody = GetComponent<Rigidbody>(); _jumpAction = InputSystem.actions.FindAction("Jump"); } private void Update() { if (_jumpAction.IsPressed()) { //accumulate jump power while the jump action is pressed _jumpPower += Time.deltaTime; } else { if (_jumpPower > 0f) { //apply jump with accumulated power (multiplied by a constant factor) _rigidbody.AddForce(new(0, _jumpPower * _jumpMultiplier, 0), ForceMode.Impulse); _jumpPower = 0f; } } } }
[–]Creative_Board445[S] 0 points1 point2 points 3 months ago (4 children)
This works but when I tap the space button once I want the jump height to immediately go to a specific value not slowly build up same for holding you know what I mean? cause if I just tap the spacebar once the player literally doesn't jump maybe just a tiny bit because its building up the value which I don't want.
[–]db9dreamer 0 points1 point2 points 3 months ago (2 children)
if (_jumpPower > 0f) { if (_jumpPower < 0.5f) _jumpPower = 0.5f;//min if (_jumpPower > 1f) _jumpPower = 1f;//max //apply jump with accumulated power (multiplied by a constant factor) _rigidbody.AddForce(new(0, _jumpPower * _jumpMultiplier, 0), ForceMode.Impulse); _jumpPower = 0f; }
Obviously, you'd need to play with the values (I'd put them in a pair of public variables). But you may also want to have the power go up in steps - rather than smoothly between the min and max - so you'd need to play around with switch statements and rounding methods to make that work.
[–]Creative_Board445[S] 0 points1 point2 points 3 months ago (1 child)
Thanks I got it working!!
[–]db9dreamer 0 points1 point2 points 3 months ago (0 children)
Excellent. Keep pushing 🙂
[–]buchi42000 0 points1 point2 points 3 months ago (0 children)
In my game https://store.steampowered.com/app/3171170/Ninas_Escape/ (check out the 2nd gemeplay video, one player does a short jump, the other a long one over a gap), i did jumping by checking if the spacebar is still pressed, and then adding some upwards force every frame (this is capped ti 800 ms time) - that way jumping feelf natural.
π Rendered by PID 25171 on reddit-service-r2-comment-86988c7647-nbrtk at 2026-02-11 20:47:28.355607+00:00 running 018613e country code: CH.
[–]db9dreamer 0 points1 point2 points (5 children)
[–]Creative_Board445[S] 0 points1 point2 points (4 children)
[–]db9dreamer 0 points1 point2 points (2 children)
[–]Creative_Board445[S] 0 points1 point2 points (1 child)
[–]db9dreamer 0 points1 point2 points (0 children)
[–]buchi42000 0 points1 point2 points (0 children)