Ctrl+K

MoveToGoalComponent

Declaration

public class Strawberry.Components.Movement.MoveToGoalComponent

Moves the entity towards a goal position.

Inherits: Strawberry.Core.BaseComponent

Properties

Transform

TransformComponent Transform { get }

Goal

Gets or sets target position to move towards.

Vector2 Goal { get set }

ArrivalRadius

Gets or sets radius at which the entity will stop moving.

float ArrivalRadius { get set }

Speed

Gets or sets the speed of the movement. (Pixels per second)

float Speed { get set }

HeadToGoal

Gets or sets the heading of the owner. If true the owner will rotate to face its direction of movement. (Default: false)

bool HeadToGoal { get set }

Methods

OnComponentAdded override

void OnComponentAdded(BaseComponent component)

Parameters:

Name Type Description
component Strawberry.Core.BaseComponent

OnUpdate override

void OnUpdate()