简体   繁体   中英

How can I make a sprite move downward in a 2D space?

I am trying to make a game object in unity just go vertically down.

I have tried using GameObject.transform() and things like that. All I am asking is, if anyone can give me something to look into such as which method or class I would use to make a 2D sprite move downward.

In Unity, you can modify the position of any object using it's transform component and it's position property. For example, if you have GameObject someSprite , you can assign a new value to someSprite.transform.position every frame. Usually it is done in your Update method, or, if you're working with physics, in the FixedUpdate method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM