I am working on a Cozy Wizard Adventure game. Looking for initial reaction to my art style?
https://redd.it/1kmy4po
@r_Unity3D
https://redd.it/1kmy4po
@r_Unity3D
Reddit
From the Unity2D community on Reddit: I am working on a Cozy Wizard Adventure game. Looking for initial reaction to my art style?
Explore this post and more from the Unity2D community
This media is not supported in your browser
VIEW IN TELEGRAM
I made a Metal Warrior x Armored Core prototype and wonder how to represent the mech control in the gameplay :3
https://redd.it/1kmz8ej
@r_Unity3D
https://redd.it/1kmz8ej
@r_Unity3D
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