I’m trying to make a re-creation of this (http://balldroppings.com/js/) simple game using Unity.
Is there a way to create a plane (with collision) during runtime that can be changed after placing?
I’m trying to make a re-creation of this (http://balldroppings.com/js/) simple game using Unity.
Is there a way to create a plane (with collision) during runtime that can be changed after placing?
To create objects, make a prefab and Instantiate it at run time.
To move and resize an object, change its transform.position and transform.localScale.
Read the documentation of these functions for details.
You could also try:
GameObject g = (GameObject)GameObject.CreatePrimitive(PrimitiveType.Cube);
g.transform.localscale=new Vector3(mywidth/2,myheight/2,mylength/2);
// from here out just change g.transform.position to move the object.
You cann also use something like this. Look for more here.
http://unity3d.com/support/documentation/ScriptReference/Plane.Plane.html
using UnityEngine;
using System.Collections;public class PlaneF : MonoBehaviour {
public Transform vector2;
public Transform vector3;void Start () {
vector2 = GameObject.Find(“vec2”).transform;vector3 = GameObject.Find("vec3").transform; Plane myPlane = new
Plane(transform.position,vector2.position,vector3.position);
}
}