Still don’t know what’s going on. Hope you can help.
My code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public Rigidbody rb;
public float ForwardForce = 2000f;
public float BackwardsForce = -2000f;
public float JumpForce = 1000f;
// Update is called once per frame
void Update ()
{
if ( Input.GetKey("right") )
{
rb.AddForce(ForwardForce * Time.deltaTime, 0, 0);
}
if ( Input.GetKey("left") )
{
rb.AddForce(BackwardsForce * Time.deltaTime, 0, 0);
}
if ( Input.GetKey("vbKeySpace") )
{
rb.AddForce(0, JumpForce * Time.deltaTime, 0);
}
}
}
It seems like perhaps you should gently put your new code attempts aside for right now and go work through a half dozen or so Unity and C# coding tutorials, perhaps the ones from Unity’s “Learn” section above, or else other third parties like Brackeys.
Every part of this is very well documented or understood, so it just doesn’t make sense to try random stuff on your own when you have not yet established a baseline of how errors can guide your successful engineering.
You seem unnecessarily rude. I’m having the same problem and I am neither lazy nor dumb. I have many years programming experience. I’m working through tutorials one by one to learn.
I suggest that people like you should keep your mouths shut and let the rest of the internet try to learn from each other instead of just yelling at people who are trying to learn.
Kurt is actually a very well respected member of this community and spends a huge amount of his time helping others. We get huge quantities of posts like this where a code-snippet is posted along with little bits of info but nowhere near enough information to actually help. From experience, it’s clear for many of these posts that it’s a case of an error is displayed and then a forum post is made with little to no effort to actually perform any kind debugging or read the appropriate documentation. Not always but very, very often.
I would suggest that it’s you who are “yelling at people” and it’s a shame you chose to make your first post like this.
Kurts post in April this year wasn’t directed at you nor does the fact that you’re having “the same problem” relate to what Kurt said.
Moving forward, being positive I would ask that if you have a problem then please make your own thread about it. Often the same error does not mean the same cause as I’m sure you know which is why we end up with threads full of “me too” and often they’re unrelated. If you feel more comfortable posting here then provide some useful info and show what debugging you’ve done so those that help, don’t have to go through all the usual debugging suggestions.