Weird Unity glitch

Updated on December 1, 2017 in [A] Brackeys Courses
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
1 on December 1, 2017

Hello !

I was wondering why when I test my Unity 3D game in ”fullscreen” it does not work but when I am not in fullscreen it works. Any ideas ? I’ve already tried restarting my PC, restarting Unity, re-read my code as-well to make sure nothing was wrong and since I’m new to Unity I don’t know wherelse I should/could look. And because 1 vid is better than 1000 words here is a video and my code :

Movement script

using UnityEngine;

public class Perso1Movement : MonoBehaviour {
    public Rigidbody rb;

    public float forwardForce = 2000f; // <– We declared a variable float to change out forwardForce … E03
    public float sidewaysForce = 500f; // REVOIRgjfajsgfaogk

    // Use this for initialization
    // void Start ()

    // voidUpdate : Update is called once per frame (So the force ”speed” will depend on how many FPS your PC has)
    void FixedUpdate () // FixedUpdate is better to calculate Physics in Unity (”makes stuff looks smoother when you collide with stuff”. Ref. Brackeys EP.2 HTMVGIU)
        rb.AddForce(0, 0, forwardForce * Time.deltaTime); // <– NOTE : Gotta understand Time.deltaTime better

        if (Input.GetKey(“d”)) // <– QUESTION : Why not ”D” and ”d” instead ? :O
            rb.AddForce(sidewaysForce * Time.deltaTime, 0, 0, ForceMode.VelocityChange);

        if (Input.GetKey(“a”)) // <– QUESTION : Why not ”D” and ”d” instead ? :O
            rb.AddForce(-sidewaysForce * Time.deltaTime, 0, 0, ForceMode.VelocityChange); // Understand ForceMode.VelocityChange better E06

Thanks !

  • Liked by
0 on December 1, 2017

Don’t double post the same question, bump your old one if it gets pushed down

  • Liked by