I need help with the following:
When player enters a certain area it triggers a spawn (could be random from a list) of a object.
Can someone help?
I need help with the following:
When player enters a certain area it triggers a spawn (could be random from a list) of a object.
Can someone help?
Unity Scripting Reference has alot of information. Also, a search engine is your friend, especially for what you are asking.
These are the relevant Unity Scripting References for your question :
some demonstration videos :
http://www.unity3dstudent.com/2010/07/beginner-b01-basic-collision-detection/
http://www.unity3dstudent.com/2010/07/beginner-b13-trigger-collision-detection/
http://www.unity3dstudent.com/2010/07/beginner-b05-instantiate-to-create-objects/
Here is a list of tutorials to get you going :
Start at the bottom and work up : Unity 3D Student - 3d Modelling
Start at the bottom and work up : Unity 3D Student - 3d Modelling
this is the YouTube link for the above as one playlist : Unity Tutorials - Essentials 00 - Projects - Unity3DStudent.com - YouTube
the Unity Wiki : http://wiki.unity3d.com/index.php/Tutorials
A list of resources : How can I start learning Unity fast? ( List Of Tutorials ) - Unity Answers
ok i have made a trigger that that currently does the following:
using UnityEngine;
using System.Collections;
public class trigger_1 : MonoBehaviour {
void OnTriggerEnter(Collider player) {
Debug.Log("Hello");
}
}
When i move my player it now triggers the msg.
But i do not know how to get ir to spawn an object + play a sound. Also i want the object to be timed to only appear for x-seconds.
Can someone help me?
ok i have made a trigger that that currently does the following:
using UnityEngine;
using System.Collections;
public class trigger_1 : MonoBehaviour {
void OnTriggerEnter(Collider player) {
Debug.Log("Hello");
}
}
When i move my player it now triggers the msg.
But i do not know how to get ir to spawn an object + play a sound. Also i want the object to be timed to only appear for x-seconds.
Can someone help me?