I don’t even know where to start with this. I just want to say that so far Unity is just plain not working how it’s supposed to.
I am an indie game developer, as most people with unity are. I started making games quite a while back, and maybe the universe just doesn’t want me to succeed or something, but nothing works. I didn’t start with Blender, but I did eventually end up there. That’s where I worked on most of my 3D game stuff. But it has never worked at all how it’s supposed to. I do my own script/model/animation/etc. but it doesn’t work, so I look up tutorials. What works for them goes horribly wrong somewhere when I do it. So then I turned to Unity. That was my first mistake.
One of the things I’m trying to do right now is get a space type door to open when you get near it. I have the box collider as trigger and a script to back it up. I did the script, but it didn’t work, so I took someone elses, which was exactly the same except for organization. But guess what? It doesn’t work. I’ve seen over 50 tutorials do the exact same thing, but it doesn’t go for me.
One of the stupidest things I’ve seen is rotations. Oh boy, God forbid rotations to work. I tell it to turn 90 degrees, so it goes quote: “x=55.5 y=72.3 z=64 w=7.1562673” all from 0, and I just don’t even know. I have tried so hard to get this to work. Five weeks trying to fix this one problem. I’ve come up empty handed.
After I finally got the stupid rotations to work and finished the animations, something so unbelievably idiotic happened that I couldn’t even think for the next three days. So I have the script set up and the collision trigger there. For some reason, even with ‘play automatically’ off, it plays nonstop when I start the game. But the thing that blew my mind was that when I walked into the trigger (Prepare to explode from insanity) It says it couldn’t find the animation… WHILE IT WAS PLAYING! I don’t even know where in the world it could possibly be looking for it other than the animations list. I’ll probably post a video at some point of this monstrous lack of sense and reality.
My script
#pragma strict
var Door : Transform;
private var Open = false;
function Start () {
}
function Update () {
if (Open == true){
changeDoorState();
}
}
function OnTriggerEnter (theCollider : Collider) {
if (theCollider.tag == “Player”){
Open = true;
}
}
function OnTriggerExit (theCollider : Collider) {
if (theCollider.tag == “Player”){
Open = false;
}
}
function changeDoorState(){
if (Open == true){
Door.animation.CrossFade(“DoorOpen”);
}
if (Open == false){
Door.animation.CrossFade(“DoorClose”);
}
}