I want to create a plane, with the plane constructor, but nothing works…
var plane = new Plane(Vector3.Up, new Vector3(0f, 0.2f, 0f));
i used this command and a couple other ones, but nothing goes through the compiler and is marked as wrong, but other users use it, could anyoneshow me, how this command works exactly and ho it’s used??
var plane = new Plane(Vector3.up, new Vector3(0f, 0.2f, 0f));
Note that in Vector3.up the “up” is lowercase. Also note that “var” can only be used inside of a method. If you want to declare a member variable of a class you have to specify the type explicitly
public class SomeClass : MonoBehaviour
{
Plane plane = new Plane(Vector3.up, new Vector3(0f, 0.2f, 0f));
void Start()
{
// [ ... ]
How exactly do you use the plane? The Plane struct has absolutely nothing to do with physics, colliders, rigidbodies or collisions of those. It’s a mathematical plane to raycast aginst using plane.Raycast. You can’t do much more with the plane. Again: It’s not a collider.