i have a game in the making-process and i have a problem. i need to have:
if <ball> is within <1> metres of <handsomePrince.torso.head>
Do
A method.
But no matter what i do or how hard i try it just won't do the method. i could have the ball inside his head but it won't work. can anyone please help?
________ Effects Of Depakote
i have a suggestion. put it in an infinite loop. because if it is just in an if statement it only checks it that one time. wherever it appears in the code. you could also put it in a while statement for the same effect.
I think I know what the problem is. The problem is that you might be putting the if statement in the wrong place. Don't put the if statement in the big main programming box. Look at the top right hand side of the screen where it says events. Click on the button that says "create new event" and then click on the one that says "While something is true".
Now something will appear in that box that says "While <none> is true" and then below it, "Begin", "During", and "End". Now, in the top "While _____ is true is where you will put the "If ball is within 1 meter of head". Now, in the second part, in the "Begin" part, put the method that you want to happen.
What the "Begin", "During", and "End" do is that it tells when to do the method. So if you put the method in the "Begin" part, the method will happen the ball is 1 meter away from his head. If you put it in "during", the method will continue to happen while the ball is within 1 meter of his head. It will not stop. And if you put it in the "End' section, the method will happen when the ball stops being within 1 meter of the head. This means that the ball has to be within 1 meter and then leave the 1 meter area before it works. So for your world, the best thing to do would be to put the method by the "begin" section. Alright I hope this helps.
I am nowhere and everywhere at the same time.
www.facebook.com/chris101b
Xbox Live GT: Chris101b
Youtube: (You guessed it) www.youtube.com/chris101b