- Home /
How to Move an Object down until a certain point then activate a function
I want to move an object downward, then when it reaches a certain point, I want to activate a function of code but I am having a lot of trouble.
Comment
Well, post the code, or describe the trouble you have, and I'm sure you'll get some help.
Answer by Krizzen · Jun 07, 2014 at 02:36 PM
Here's how you would do exactly what you asked. Just change "CERTAINPOINT" to how far down you want the object to go.
void Update () {
if (position.y < CERTAINPOINT)
doFunction();
}
void doFunction() {
// do stuff here
}
If you want more advanced functionality, you'll have to be more specific. There are tons, and tons of ways to do what you want depending on how you want it done (if that makes any sense!).
Your answer
Follow this Question
Related Questions
Making a bubble level (not a game but work tool) 1 Answer
Multiple Cars not working 1 Answer
Help with Grid Movement 2 Answers
movement 2d in a grid 3 Answers