Why is Unity not working, BUT ONLY FOR ME!?

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”);
}
}

The fact that an animation is playing has nothing to do with whether or not a script can find it. “Door” refers to a Transform. Door.animation refers to an Animation component attached to the Transform’s GameObject. If there isn’t one exactly where it expects to find it, that will be null and result in the error you were getting. So, first, make sure the Animation component in that specific location.

Then, one at a time… what specific questions do you have that we can maybe help with?

Also, please, for the love of God, use code tags!

That WXYZ rotation your talking about is quaternion. Make sure your rotating in one rotational axis only. I’m not very experienced with unity but try checking if you can change that rotation to euler XYZ. For me, quaternion is the worst rotation to animate with in blender/maya because it changes everything even if you just want to rotate on one axis. Rotating in euler is your best bet in getting a clean result like x=0, y=90, z=0.

to the code tags, something went wrong when I put it there and it really messed it up, so I just wrote in the basics of it. Also, it didn’t like the position of the lines either. it wouldn’t accept the spaces.

I have the transform as the door, and the animation on the door object. Where else could it be looking?

I wasn’t exactly looking for an answer to a specific question. It just seems that nothing has ever worked for me, so I thought I’d put it up and see if anyone has similar problems. Although, finding out what the problem is and fixing it would be good too. But I’m pretty sure the universe just hates me. I was actually thinking about it today and I’m pretty sure no tutorial I’ve ever tried has actually worked, so yeah.

also, euler does the same thing. rotations all over the place.

If nothing has ever worked for you - not even code tags in a forum - then my suggestion is that perhaps you’re not paying close enough attention to details. Detail is everything in programming, and it’s one of the early hurdles for newcomers. If things aren’t exact and precise computers have a tendency to throw violent fits of rage. This is not helped by the fact that there are many tutes out there that are indeed terrible, compounded by the fact that the people who most need them are the ones who are least able to spot the difference between a good one and a bad one.

When you say “just wrote the basics of it”, is what you’ve got in the OP the actual script? Can you post a screenie of the scene hierarchy with your door in it, with the door selected to sow in the Inspector?

Also, show us the rotation code. Rotation is pretty tricky initially, but once you get one working you can learn a fair bit just by playing around with it.

Also, out of interest, have you tried the official tutes from the Unity Learn team? Link is in the nav bar at the top of the page. I’ve only had a very brief browse of what’s on offer, but what I saw gets my thumbs up.