moonbat
moonbat
CC#
Created by moonbat on 12/28/2024 in #help
Is there a way to make this a shorter phrase.
I was wondering if i was able to put both input under the same name. something like
if(cheeseburger){jump}
if(cheeseburger){jump}
, rather than this
using System.Linq.Expressions;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.UI;
public class Playerjump : MonoBehaviour
{
[SerializeField] private float _velocity = 1.5f;
private Rigidbody2D _rb;

// 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()
{
if (Mouse.current.leftButton.wasPressedThisFrame)
{
_rb.linearVelocity = Vector2.up * _velocity;
}

if (Keyboard.current.spaceKey.wasPressedThisFrame)
{
_rb.linearVelocity = Vector2.up * _velocity;
}
}
}
using System.Linq.Expressions;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.UI;
public class Playerjump : MonoBehaviour
{
[SerializeField] private float _velocity = 1.5f;
private Rigidbody2D _rb;

// 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()
{
if (Mouse.current.leftButton.wasPressedThisFrame)
{
_rb.linearVelocity = Vector2.up * _velocity;
}

if (Keyboard.current.spaceKey.wasPressedThisFrame)
{
_rb.linearVelocity = Vector2.up * _velocity;
}
}
}
6 replies
CC#
Created by moonbat on 12/25/2024 in #help
Player death script(fixed)
No description
17 replies
CC#
Created by moonbat on 12/11/2024 in #help
My Visual Studio code keeps making this error
dotnet watch ❌ [Strings (net9.0)] Failed to read capabilities: Unable to read beyond the end of the stream. i dont know how to fix it or if it needs to be fixed. the script runs fine, but it still gives me that message. chat gpt was saying that it could be an memory error, or corrupted file, but i feel like it wouldn't hurt to ask around
4 replies