Log inGet started
Package

KartFx.component

Newest version

README.md

KartFx

A race kart's effects, drawn on every player's screen from state that is already synced, so nothing extra is sent over the network:

  • Boost flames: twin glowing exhaust jets from the kart's tail while a boost item pushes it (Racer.boosting) or its own Shift boost fires (vehiclesKit Vehicle.boosting).
  • Water spray: white foam thrown up and back from the rear wheels while the kart drives faster than walking pace on the road of a water track.

Both are entries of racingKit's own kartFx effect (boost and spray), played rooted on the kart: a play starts when the effect should show and stops when it should not.

Racing.kart (and so Racing.race) adds it to every race kart; it goes on a vehiclesKit kart root next to racingKit.Racer. It works out the kart's speed from how far it moved each frame, so a kart another player drives sprays as smoothly as your own.

Fields: flames (show boost flames), spray (show water spray on water tracks).

Method: state() returns { speed, boost, wet, flamesPlaying, sprayPlaying }: the speed it measured (m/s), whether the kart is boosting or on water now, and which effects are playing.