how to create a moving object and change its velocity ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Bibin
:warning: Old Version Published before Godot 3 was released.

Which type of object? Is it 2D or 3D?
How do you want it to move? And when?
Please explain the details of what you want.

Zylann | 2016-10-19 13:05

Object is a sprite image. i want to move it horizontally and i want to change its velocity randomly when it moving. and its 2D.

Bibin | 2016-10-19 13:26

Do you want the direction to change slightly randomly while moving, or generate a direction and send it on that direction the moment it spawns?

Tybobobo | 2016-10-20 04:14

Its ok for me that the direction to change slightly randomly while moving and also the velocity will change randomly.

Bibin | 2016-10-20 06:50

:bust_in_silhouette: Reply From: eons

You just need to apply basic physics math to the position of your node, if you are not used physics or physics applied to games/programming, I suggest to look for basic movement and physics programming tutorials before venturing further.

i want to do it using gdscript

Bibin | 2016-10-20 01:59

:bust_in_silhouette: Reply From: Zylann

This is not exactly what you want, but it may help you moving a sprite: https://forum.godotengine.org/8375/making-a-sprite-move