#pragma strict
function OnTriggerEnter (other : Collider)
{
renderer.enabled = false;
yield WaitForSeconds (8);
renderer.enabled = true;
}
Here is the script so that when you encounter the box collider the plant will disappear for 8 seconds and the re-appear.
Friday, 19 April 2013
Tuesday, 16 April 2013
Possible Following A.I. code?
I found this on UnityAnswers, its originally for an enemy to follow player but it doesn't have any triggers in it its simply the following aspect of the script. It's Java.
- var target : Transform; //the target
- var moveSpeed = 3;
- var rotationSpeed = 3; //speed of turning
-
- var myTransform : Transform; //current transform data of A.I.
-
- function Awake()
- {
- myTransform = transform;
- }
-
- function Start()
- {
- target = GameObject.FindWithTag("Player").transform; //target the player
-
- }
-
- function Update () {
- //rotate to look at the player
- myTransform.rotation = Quaternion.Slerp(myTransform.rotation,
- Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed*Time.deltaTime);
-
- //move towards the player
- myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
-
-
- }
from what I can gather so long as we have the firstperson camera tagged player
(which i think it is) we attach this code to the A.I. and it should follow
no matter how far away the player is.
Also this was on UnifyCommunity wiki.
.http://wiki.unity3d.com/index.php/Flocking
Visor - Maya
Though this would be useful for anyone making 3D assets. Could use these as a base and edit them.
Under Window>General Editors>Visor
Has a number of various meshes which could be edited into alien plants.
Monday, 15 April 2013
15th April 2013 Meeting
JJ: Finish AI
Alice: Applying pickup scripts
Alistair: Terrain and lighting
Toop: Sort out existing models, make more plants
Cat: Not sure so have this picture? ^_^
Cathleen here, just adding from what I've heard the deadline for this project is may 9th? so I'm not sure how everyone feels about the things they are doing or when they can finish them but i know that we should be aiming to have this game pretty much working with at least two pickups and respawns two effects (with any luck or else one) and some gui text that pops up with you encounter something important. From what I see alice has the pickup code it just needs applied, I want to work on making an effect occur when you pickup the plant so alice i think i'll be adding to you code for that ? and also have gui text pop up in different place like when you leave the pod an introduction, when you encounter a plant information, that kind of thing.
I want to apologise that I have been off longer as in not back in time for class, and for not posting thing ill aim to have all my stuff uploaded for thursday so you can see some of it may be a repeat of what alice has posted in fact i think alice your code is better but i'll post what i was working on.
P.S. love the picture very goofy :D
Alice: Applying pickup scripts
Alistair: Terrain and lighting
Toop: Sort out existing models, make more plants
Cat: Not sure so have this picture? ^_^
Cathleen here, just adding from what I've heard the deadline for this project is may 9th? so I'm not sure how everyone feels about the things they are doing or when they can finish them but i know that we should be aiming to have this game pretty much working with at least two pickups and respawns two effects (with any luck or else one) and some gui text that pops up with you encounter something important. From what I see alice has the pickup code it just needs applied, I want to work on making an effect occur when you pickup the plant so alice i think i'll be adding to you code for that ? and also have gui text pop up in different place like when you leave the pod an introduction, when you encounter a plant information, that kind of thing.
I want to apologise that I have been off longer as in not back in time for class, and for not posting thing ill aim to have all my stuff uploaded for thursday so you can see some of it may be a repeat of what alice has posted in fact i think alice your code is better but i'll post what i was working on.
P.S. love the picture very goofy :D
Subscribe to:
Posts (Atom)