Obby (Obstacle Course) Components

Name: Obby Components

Obby components provides a set of useful templates and scripts to help make more exciting obstacle courses. You can use the provided templates and adjust them as needed, or create your own obstacles by adding the “activationTimerScript” to an entity, along with an obstacle script (they all start with “obstacle”), and using event properties to connect up the logic.

Included templates
Obstacle_BlastPoint

  • Loops, constantly playing an explosion that blasts players away and deals a small amount of damage

Obstacle_CollisionBlast

  • An object that explodes when a player collides with it, dealing high damage and blasting away nearby players

Obstacle_FallingPlatform

  • A platform that will pause for a short random time, then wobble for a short time, and then fall

Obstacle_InvisiblePlatform

  • A platform which is invisible, but becomes visible for a few seconds when a player lands on it (so players must guess where it is, might work well with a rotate and move script added too)

Obstacle_SwingingAxe

  • An axe (which could be changed into any object) that will swing a few times when a player enters its trigger area, before resetting. It can be adjusted to swing further, in different axes, with different dropoff and number of swings

Obstacle_TimedBlocker

  • An object which will loop toggling visibility and collision, in this case a wall which will turn on and off at random times

Useful scripts
ActivationTimerScript

  • This controls activating and deactivating (or resetting) the obstacles. It can have a fixed or random time to activate and deactivate, using the event properties
  • This should be present on all obstacles, and the event to trigger the obstacle (e.g. OnCollision) should use the “Go” function on this
  • If you tick “looping” then it will constantly activate and deactivate based on its timers from the game start

ObstacleVisibilityScript

  • This can hide and show an object, optionally turning its collision on or off as well

ObstacleBlastScript

  • This will play a blast sound and effect, launch players away depending on their proximity to it, if they were in the radius, and optionally do damage to them as well

ObstacleSwingScript

  • This handles an obstacle playing a number of “swings”, which will end in a half-swing (so it settles to a “normal” position), before resetting by returning to its start rotation
  • It will swing in one axis, which you can choose, by the given angle - it will start at that angle, then go to the negative of that angle, and then back again
  • The swing dropoff determines how much “momentum” it loses with each swing, to make it look like its acting under gravity

ObstacleFallScript

  • This will cause its entity to wobble (done on all clients so it appears smoother) and then move by the given vector over the given time
  • When this script is reset, it will come in from the opposite of the vector that it “fell” to, i.e. if it falls directly down, then it will reset by dropping in from above to its normal position
4 Likes

This will be super helpful! I just discovered this morning that one of my rotating traps doesn’t always reset to the correct position. I’m also definitely going to use that blast template somewhere :slight_smile: :japanese_ogre:

1 Like

The blast is great fun, even just trying it in our test world we couldn’t stop laughing :laughing:

1 Like

Good stuff!


That looks a little bit harsh! :stuck_out_tongue: Looking forward to this next deathrun level

This package made creating obstacle courses incredibly fun and easy!

However, I think there might be a small issue in the ObstacleFallScript, that manifests itself if the parent tree is not located at [0,0,0], i.e. if you have multiple top-level terrains as part of several obstacle tracks, etc. that are not at the original terrain position.

For those, I think the ObstacleFallScript:Wobble() method needs to set startPos different, by using:

local startPos = self:GetEntity():GetRelativePosition()

Instead of using GetPosition(). Otherwise the wobble logic seemed to not work as expected.

Or it could be that I was holding it wrong, which could very well be true.

You’re absolutely right, updated the package with the fix now