class Projectile : ZilchComponent { [Property] var Speed: Real = 0.4; [Property] var Direction: Real3 = Real3(); function Initialize(init : CogInitializer) { // We need to update the projectile's movement every logic update Zero.Connect(this.Space, Events.LogicUpdate, this.OnLogicUpdate); } function OnLogicUpdate(event : UpdateEvent) { // Apply movement this.Owner.Transform.Translation += this.Direction * event.Dt * this.Speed; } }