using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public class Rocket : MonoBehaviour {
Rigidbody rb;
// Use this for initialization
void Start () {
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update ()
{
ProcessInput();
}
private static void ProcessInput()
{
if(Input.GetKey(KeyCode.Space))
{
rb.AddRelativeForce(Vector3.up);
}
if(Input.GetKey(KeyCode.LeftArrow))
{
print("Left Rotate");
}
else if(Input.GetKey(KeyCode.RightArrow))
{
print("Right Rotate");
}
}
}
Im getting ,An object reference is required to access non-static member, as an error. I refered rb to Rigidbody but the program does not notice it.