Question by
Satish004 · Jul 16, 2019 at 03:27 PM ·
transformlocalscalelocalpositiontransforms
How can i reset position of my obstacle??
I m Working On 2d game?? how can i reset position of my obstacle??
problem is : my obstacle is continuously wide(y position) but i want to reset my position(y position)??help
Code:
// Use this for initialization
void FixedUpdate()
{
goTopToDown();
}
void goTopToDown()
{
//obstacle move top to down
//current position obstacle
Vector3 currentPos = transform.localPosition += Vector3.down * speed * Time.deltaTime;
//scaling position obstacle //(scalling only y position)
Vector3 scalingobstacleposition = transform.localScale += new Vector3(0, 0.25f, 0) * Time.deltaTime;
//but i want to reset position of my obstacle
}
//i want to some effect on my obstacle// i m writing code for y position but not reset y position
Referance: https://imgur.com/a/FDDxu2D
Comment
Your answer
Follow this Question
Related Questions
objects of same parrent random scale/size(xy and z) 0 Answers
Can you help explain this positioning conundrum to me! 1 Answer
Unwanted Decimal Value When Scaling Object 1 Answer
I can not modify localscale while I'm playing because of the Animator. 1 Answer
Changing transform.localscale doesn't take affect immediately? The next RayCast isn't precise 1 Answer