- Home /
need help with a script
My name is Robert rousan i am working on a simple break out game to get me started with unity what i need help with is when the ball drops past the paddle it goes off screen i need help with respwaning it at a set position thanks also im doing this in c sharp and i have lookedf around allready
Answer by Sericet · Jan 21, 2012 at 04:39 PM
Make a script and attach it to your ball object and write
Function Update()
{
If(transform.y<20)
{
Transform.y = 50;
}
}
This code will check all the time to see if your object has fallen below a y position of 20, if that is true it will put it back to 50, change these values to fit what you want.
Your answer
![](https://koobas.hobune.stream/wayback/20220613063234im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Scripting error #2! 2 Answers
I am trying to make a movement script for my main camera but it isnt working! 2 Answers
Reset button 1 Answer