Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

thoted49

7
Posts
2
Topics
A member registered Feb 08, 2021

Creator of

Recent community posts

This is my first Game Jam Ever! Does anyone have any pointers? Also good luck everyone! :)

Thank you So much! :) I worked on the movement for the past 5 days!

*loop

Could you make a spirit, japanese music lopop?

New

Hi! I am New to Unity and the I have a problem with my script

Here is the script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour {

public float speed;
public float jumpForce;
public float moveInput;

private Rigidbody2D rb;

void start(){
rb = GetComponent<Rigidbody2D>();
}

void FixedUpdate(){

moveInput = Input.GetAxis("Horizontal");
rb.velocity = new Vector2(moveInput * speed, rb.velocity.y);
}

}


And here is the error message:

NullReferenceException: Object reference not set to an instance of an object
PlayerController.FixedUpdate () (at Assets/PlayerController.cs:20)

NEVER GIVE UP!!!

New

Hi! I am New to Unity and the I have a problem with my script

Here is the script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour {

public float speed;
public float jumpForce;
public float moveInput;

private Rigidbody2D rb;

void start(){
rb = GetComponent<Rigidbody2D>();
}

void FixedUpdate(){

moveInput = Input.GetAxis("Horizontal");
rb.velocity = new Vector2(moveInput * speed, rb.velocity.y);
}

}


And here is the error message:

NullReferenceException: Object reference not set to an instance of an object
PlayerController.FixedUpdate () (at Assets/PlayerController.cs:20