Game Development Community

Help with code

by Harrison Brock · in Torque Game Builder · 09/20/2006 (2:10 pm) · 2 replies

I have any two kind of object. A ball and a bucket. The ball is one bucket1 but I want the ball to move and mount to bucket 2 if the bucket1 and bucket2.getRotation() = 45. and so on for other buckets. Am I write the if statment right

if(bucket1.getRotation() = 45 && bucket.getRotation() = 45)
{
ball.mount(bucket2,0,0,0,true, false,false);
}

#1
09/20/2006 (2:59 pm)
Bucket1.getRotation() == 45

You use two equals signs for a comparison operator.
#2
09/20/2006 (5:49 pm)
I aslo need to check if the ball is mount to a bucket too. I know that this is not right but it what I need.

if(ball.getIsMounted().bucket1)
{
if(bucket1.getRotation() = 45 && bucket.getRotation() = 45)
{
ball.mount(bucket2,0,0,0,true, false,false);
}
}

Harrison Brock