Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

move_towards_point

drewmccluskey edited this page Feb 10, 2019 · 4 revisions

move_towards_point

Move object towards a given position at a rate of pixels per step

Syntax:

move_towards_point(point, pixels)
Argument Description
Vector point Target position
double pixels Pixels to move per call

Returns: void

Description:

This function will move your GameObject to the given position by a number of pixels as specified.

Example:

move_towards_point(new Vector2(2, 0), 4);

The above code will move GameObject towards the left upper corner at a rate of 4 pixels per call.

Back to Movement

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /