infinite jump
hey guys , i got infinite jumping in my unity project but i dont want it . i tried a code from a tutorial but it doesnt work . here it is
using UnityEngine.InputSystem;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class PlayerController : MonoBehaviour
{
[Header("Horizontal Movement Settings")]
// variable
private Rigidbody2D rb;
[SerializeField] private float walkspeed = 10;
private float xAxis;
[Header("ground check settings")]
[SerializeField] private float jumpForce = 45;
[SerializeField] private Transform GroundCheckPoint;
[SerializeField] private float groundCheckY = 0.2f;
[SerializeField] private float groundCheckX = 0.5f;
[SerializeField] private LayerMask whatIsGround;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
rb = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update()
{
getInputs();
move();
jump();
if (Input.GetButtonDown("Jump"))
{
rb.linearVelocity = new Vector2(rb.linearVelocity.x, jumpForce);
}
}
// Permet de recevoir les touches presse par le joueur et leur attribues une action
void getInputs()
{
xAxis = Input.GetAxisRaw("Horizontal");
}
void move()
{
rb.linearVelocity = new Vector2(walkspeed * xAxis, rb.linearVelocity.y);
}
public bool Grounded()
{ //permet de verifier si le joueur est sur une plateforme ou non
if (Physics2D.Raycast(GroundCheckPoint.position, Vector2.down, groundCheckY, whatIsGround)
|| Physics2D.Raycast(GroundCheckPoint.position + new Vector3(groundCheckX, 0, 0), Vector2.down, groundCheckY, whatIsGround)
|| Physics2D.Raycast(GroundCheckPoint.position + new Vector3(-groundCheckX, 0, 0), Vector2.down, groundCheckY, whatIsGround))
{
return true;
}
else
{
return false;
}
}
void jump()
{
if(Input.GetButtonUp("Jump") && rb.linearVelocity.y > 0)
{
rb.linearVelocity = new Vector2(rb.linearVelocity.x, 0); //permet dannuler le jump en pleine air
}
if(Input.GetButtonDown("Jump") && Grounded())
{
rb.linearVelocity = new Vector3(rb.linearVelocity.x, jumpForce);
}
}
}
https://redd.it/1kn2wz0
@r_Unity3D
hey guys , i got infinite jumping in my unity project but i dont want it . i tried a code from a tutorial but it doesnt work . here it is
using UnityEngine.InputSystem;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class PlayerController : MonoBehaviour
{
[Header("Horizontal Movement Settings")]
// variable
private Rigidbody2D rb;
[SerializeField] private float walkspeed = 10;
private float xAxis;
[Header("ground check settings")]
[SerializeField] private float jumpForce = 45;
[SerializeField] private Transform GroundCheckPoint;
[SerializeField] private float groundCheckY = 0.2f;
[SerializeField] private float groundCheckX = 0.5f;
[SerializeField] private LayerMask whatIsGround;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
rb = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update()
{
getInputs();
move();
jump();
if (Input.GetButtonDown("Jump"))
{
rb.linearVelocity = new Vector2(rb.linearVelocity.x, jumpForce);
}
}
// Permet de recevoir les touches presse par le joueur et leur attribues une action
void getInputs()
{
xAxis = Input.GetAxisRaw("Horizontal");
}
void move()
{
rb.linearVelocity = new Vector2(walkspeed * xAxis, rb.linearVelocity.y);
}
public bool Grounded()
{ //permet de verifier si le joueur est sur une plateforme ou non
if (Physics2D.Raycast(GroundCheckPoint.position, Vector2.down, groundCheckY, whatIsGround)
|| Physics2D.Raycast(GroundCheckPoint.position + new Vector3(groundCheckX, 0, 0), Vector2.down, groundCheckY, whatIsGround)
|| Physics2D.Raycast(GroundCheckPoint.position + new Vector3(-groundCheckX, 0, 0), Vector2.down, groundCheckY, whatIsGround))
{
return true;
}
else
{
return false;
}
}
void jump()
{
if(Input.GetButtonUp("Jump") && rb.linearVelocity.y > 0)
{
rb.linearVelocity = new Vector2(rb.linearVelocity.x, 0); //permet dannuler le jump en pleine air
}
if(Input.GetButtonDown("Jump") && Grounded())
{
rb.linearVelocity = new Vector3(rb.linearVelocity.x, jumpForce);
}
}
}
https://redd.it/1kn2wz0
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
This media is not supported in your browser
VIEW IN TELEGRAM
We've been working on a game about organizing colorful stuff, finally feels like it’s taking shape!
https://redd.it/1kn3vgc
@r_Unity3D
https://redd.it/1kn3vgc
@r_Unity3D
Unity Car Controller – Easy Tutorial (2025)
https://youtu.be/9Cdky9Wmus8
https://redd.it/1kn47l7
@r_Unity3D
https://youtu.be/9Cdky9Wmus8
https://redd.it/1kn47l7
@r_Unity3D
YouTube
Unity Car Controller With Wheel Collider – Easy Tutorial (2025)
Learn how to create a simple and realistic car controller in Unity using Wheel Colliders! 🚗
In this step-by-step tutorial, I’ll guide you through the basics of vehicle movement in Unity. We’ll use Unity's built-in Wheel Colliders to simulate realistic car…
In this step-by-step tutorial, I’ll guide you through the basics of vehicle movement in Unity. We’ll use Unity's built-in Wheel Colliders to simulate realistic car…
Sprite is clipping
https://preview.redd.it/hgq9juw5ix0f1.png?width=1919&format=png&auto=webp&s=ae9556b3dd3af5f1ae2027175c45ada5501e8508
When i walk arround the sprite it goes like this an i dont know how to fix it. I you have anny questions u can ask
https://redd.it/1kn5jg7
@r_Unity3D
https://preview.redd.it/hgq9juw5ix0f1.png?width=1919&format=png&auto=webp&s=ae9556b3dd3af5f1ae2027175c45ada5501e8508
When i walk arround the sprite it goes like this an i dont know how to fix it. I you have anny questions u can ask
https://redd.it/1kn5jg7
@r_Unity3D
Broventure: The Wild Co-op — Full Release is Here!
https://youtu.be/M1Y2GUP22PY
https://redd.it/1kn8832
@r_Unity3D
https://youtu.be/M1Y2GUP22PY
https://redd.it/1kn8832
@r_Unity3D
YouTube
Broventure: The Wild Co-op | Release Trailer
A roguelike co-op game where you and your friends can team up to face waves of enemies, unlock unique hero synergies, and build your own camp.
Learn more and wishlist at Steam: https://store.steampowered.com/app/2939640/Broventure_The_Wild_Coop/
Follow…
Learn more and wishlist at Steam: https://store.steampowered.com/app/2939640/Broventure_The_Wild_Coop/
Follow…
Am I missing something about shaders?
Hi everyone,
I've came back to unity after a couple of years, and tried to add a simple full-screen effect on my 2D game. The idea is simple: take the current frame, take the previous frame, and display the pixel wise difference between the two.
I've looked at at least 5 different tutorials about Shaders, Render Features, Volume Render Features, Shader Graph etc. and none of them have given me a working result. I even tried to use ChatGPT as a last resort to try to get a minimal example working, but to no avail. Something was always wrong, incompatible, or not working. I am therefore asking the question:
Is there something fundamentally complicated with Unity's URP, or am I missing something obvious to create simple custom post-processing effects?
Thank you in advance, for context I'm a Software Engineer by trade, and manage to get most of what I want in Unity to work, but I'm stumped that I wasted hours on something that I expected to be simple.
https://redd.it/1kndp8m
@r_Unity3D
Hi everyone,
I've came back to unity after a couple of years, and tried to add a simple full-screen effect on my 2D game. The idea is simple: take the current frame, take the previous frame, and display the pixel wise difference between the two.
I've looked at at least 5 different tutorials about Shaders, Render Features, Volume Render Features, Shader Graph etc. and none of them have given me a working result. I even tried to use ChatGPT as a last resort to try to get a minimal example working, but to no avail. Something was always wrong, incompatible, or not working. I am therefore asking the question:
Is there something fundamentally complicated with Unity's URP, or am I missing something obvious to create simple custom post-processing effects?
Thank you in advance, for context I'm a Software Engineer by trade, and manage to get most of what I want in Unity to work, but I'm stumped that I wasted hours on something that I expected to be simple.
https://redd.it/1kndp8m
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
🔥 Built My Game in Unity Over 8 Years — Then Showed It at PAX East 2025
https://redd.it/1kndn28
@r_Unity3D
https://redd.it/1kndn28
@r_Unity3D
Reddit
From the Unity3D community on Reddit: 🔥 Built My Game in Unity Over 8 Years — Then Showed It at PAX East 2025
Explore this post and more from the Unity3D community