MRW419
Explore posts from serversVVALORANT
•Created by MRW419 on 5/20/2024 in #community-help
Why does my PC freeze whenever I tab back in Val?
So I typically tab out Val after I die to do stuff on my computer but lately whenever I click on Val. My PC as a hole freezes, I can hear audio but nothing moves and I have to compelety restart my PC. It has gotten me a few minutes bans now and it really getting to me.
2 replies
Why is it not calling the OnCollisionEnter method?
"'cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Rigidbody2D))]
public class Player : MonoBehaviour
{
// TODO: Reference to Rigidbody2D component should have class scope. public Rigidbody2D rigidbody2d; // TODO: A float variable to control how high to jump / how much upwards public float Jump = 10.0f; // force to add. public float force = 5.0f; // Start is called before the first frame update void Start() {
// TODO: Use GetComponent to get a reference to attached Rigidbody2D rigidbody2d = gameObject.GetComponent<Rigidbody2D>(); } // Update is called once per frame void Update() { // TODO: On the frame the player presses down the space bar, add an instant upwards if(Input.GetKeyDown(KeyCode.Space)) { OnCollisionEnter(Collision, other);
} // force to the rigidbody. } void OnCollisionEnter(Collision other) { if(other.gameObject.CompareTag("Ground")) { Vector3 jump = transform.up; GetComponent<Rigidbody2D>().AddForce(jump * force, ForceMode2D.Impulse); } } } "'
// TODO: Reference to Rigidbody2D component should have class scope. public Rigidbody2D rigidbody2d; // TODO: A float variable to control how high to jump / how much upwards public float Jump = 10.0f; // force to add. public float force = 5.0f; // Start is called before the first frame update void Start() {
// TODO: Use GetComponent to get a reference to attached Rigidbody2D rigidbody2d = gameObject.GetComponent<Rigidbody2D>(); } // Update is called once per frame void Update() { // TODO: On the frame the player presses down the space bar, add an instant upwards if(Input.GetKeyDown(KeyCode.Space)) { OnCollisionEnter(Collision, other);
} // force to the rigidbody. } void OnCollisionEnter(Collision other) { if(other.gameObject.CompareTag("Ground")) { Vector3 jump = transform.up; GetComponent<Rigidbody2D>().AddForce(jump * force, ForceMode2D.Impulse); } } } "'
11 replies
❔ I'm having trouble with my assigment and I need help understanding
I'm learning Unity in my game design class and in Unity it tells me i'm missing one semi-colon but where?
if (numOne > numTwo)
{
print("numOne is greater then numTwo");
}
else (numOne == numTwo)
{
print("numOne is equal to numTwo");
}
8 replies