Conveyor Belt BP

Hello,

I’m working on creating a Conveyor belt blueprint, similar to that one: Unreal Engine | Splines - Conveyor Belt BP
With only difference that objects moving on conveyor belt need to stop for 5 seconds, and them move again in the same direction for 8 seconds.


Now it works, I mean objects are moving across but, I’m not sure where to plug those nodes responsible for stops.

Hey @Zumwolt!

You only need one timer. Here:

Hope this helps :innocent:

2 Likes

Thank you for the answer, I’m sure that would work, but I’m not good with BP, those nodes I’ve made with help of Google AI, basically used it as a guidline.

I have a troubles with calling for those nodes SET:


And those custom events, are they created as events and placed as events to, in EvenGraph?

Here is a guidline it gaves me:

Of course. Creating a conveyor belt with a start-stop cycle is a perfect task for Blueprints. The core of this logic will be managed by Timers to handle the 8-second “on” and 5-second “off” states, and a Box Collision volume to determine which objects should be moved.

Here is a detailed, step-by-step guide on how to create this Blueprint.

Overview of the Logic

  1. State Management: We’ll use a Boolean variable, let’s call it bIsMoving, to track whether the conveyor is currently active or stopped.
  2. Movement: On Event Tick (every frame), we will check if bIsMoving is true. If it is, we’ll get all actors inside our Box Collision and move them.
  3. Timing Cycle: We will use two functions, StartMoving and StopMoving.
    • StartMoving will set bIsMoving to true and set a timer to call StopMoving after 8 seconds.
    • StopMoving will set bIsMoving to false and set a timer to call StartMoving after 5 seconds.
    • This cycle will be initiated in the BeginPlay event and will loop indefinitely.

Step 1: Creating the Conveyor Blueprint

  1. In the Content Browser, right-click and select Blueprint Class.
  2. Choose Actor as the parent class and name your Blueprint something like BP_TimedConveyor.
  3. Double-click to open the Blueprint editor.

Step 2: Adding Components

In the Components panel, add the following:

  1. Static Mesh Component: This will be the visual part of your conveyor belt. Name it ConveyorMesh.
    • In its Details panel, select a suitable static mesh (e.g., a simple cube scaled into a flat rectangle).
  2. Box Collision Component: This will be the trigger volume that moves objects. Name it MoveVolume.
    • Position and scale this box so it sits just above the surface of your ConveyorMesh. Any object that enters this volume will be moved.

Your component hierarchy should look like this:

  • DefaultSceneRoot
    • ConveyorMesh
    • MoveVolume

Step 3: Creating the Variables

In the My Blueprint panel, create the following variables:

  1. bIsMoving
    • Variable Type: Boolean
    • Purpose: Tracks the current state of the belt.
    • Default Value: Leave as false (or check it if you want it to start moving immediately).
  2. MoveSpeed
    • Variable Type: Float
    • Purpose: How fast the objects should move.
    • Default Value: 100.0 (adjust as needed).
  3. MoveDuration
    • Variable Type: Float
    • Purpose: How long the belt moves for.
    • Default Value: 8.0
  4. StopDuration
    • Variable Type: Float
    • Purpose: How long the belt is stopped for.
    • Default Value: 5.0

Make sure to click the “eye” icon next to these float variables to make them Instance Editable. This will let you change their values for each conveyor belt you place in your level without having to open the Blueprint.

Step 4: Setting Up the Timer and State Functions

We need two custom events to control the cycle.

  1. Right-click in the Event Graph and select Add Custom Event…. Name it StartMoving.
  2. Do it again and create another event named StopMoving.

Now, wire them up like this:

  • StartMoving Event:

    1. Drag out a Set bIsMoving node and check the box to set it to true.
    2. From its execution pin, add a Set Timer by Function Name node.
    3. Configure the timer:
      • Object: Self (it’s the default).
      • Function Name: StopMoving (type this in exactly).
      • Time: Connect your MoveDuration variable.
      • Looping: Leave this unchecked.
  • StopMoving Event:

    1. Drag out a Set bIsMoving node and leave the box unchecked to set it to false.
    2. From its execution pin, add another Set Timer by Function Name node.
    3. Configure this timer:
      • Object: Self.
      • Function Name: StartMoving.
      • Time: Connect your StopDuration variable.
      • Looping: Leave this unchecked.

This creates a self-perpetuating loop: StartMoving runs for 8 seconds, then calls StopMoving. StopMoving runs for 5 seconds, then calls StartMoving again.

Step 5: The Movement Logic (Event Tick)

Now we’ll implement the logic that actually moves the objects.

  1. Find the Event Tick node.
  2. Drag off its execution pin and add a Branch node. Connect bIsMoving to the Condition pin.
  3. From the True pin of the Branch, get a reference to your MoveVolume component.
  4. Drag off the MoveVolume pin and find the Get Overlapping Actors node. This will return an array of all actors currently inside the box.
  5. Drag off the Out Actors array pin and add a For Each Loop node.
  6. From the Loop Body execution pin of the loop, add an Add Actor World Offset node.
  7. Connect the Array Element pin from the loop to the Target of the Add Actor World Offset. This tells the node which actor to move.
  8. For the Delta Location, we need to calculate the movement vector:
    • Get your MoveSpeed variable.
    • Get the World Tick Seconds from the Event Tick node. Multiply (*) these two values.
    • Get a reference to the BP_TimedConveyor itself (you can use a Get Actor Forward Vector node).
    • Multiply (*) the forward vector by the float result from the speed calculation. This gives you a direction and a frame-rate independent distance.
    • Connect this final Vector pin to the Delta Location input.

Step 6: Starting the Cycle

Finally, we just need to kick the whole thing off when the game starts.

  1. Find the Event BeginPlay node.
  2. From its execution pin, call your StartMoving function.

Final Check and Object Configuration

  1. Compile and Save your Blueprint.
  2. Drag BP_TimedConveyor into your level.
  3. Crucially: For any object that you want the conveyor to move, you must:
    • Select the object in the level or open its Blueprint.
    • In its Details panel, set its Mobility to Movable. Static objects cannot be moved at runtime.
    • Ensure the object has collision enabled and is set to generate overlap events. By default, most physics objects will work correctly.

Now, when you play the game, any movable object you place on the conveyor will be carried along its forward direction for 8 seconds, stop for 5 seconds, and then repeat the cycle.

I’ve tried to replicate it, but it’s not working for me, I mean objects not even moving

Did you set the default values of our Move Time and Wait Time variables?

To set the default value of a var, select it either from the Variables section in the My Blueprint window, or from the Event Graph, then while having it selected, navigate to the Details window on the right side, and assign your desired value (which in your case would be 8 for Move Time and 5 for Wait Time like you wanned to) from the Default Value section at the bottom.

Also, this was supposed to be an addition to your existing exec flow that starts with Event Tick. Did you remove that part? Keep your Branch node after Event Tick and if our bool type var is True, execute the Add Actor World Offset node for the overlapping actors using the For Each Loop node.

Yes, I’ve set values for Move and Time variables, exactly like that. This is what it looks like:


Object are moving along the conveyor BP, but no stops. Movements speed is 50 now.

You didn’t connect the custom event to Set Timer by Event, so the moving flag is set true on Begin Play and remains so forever more:

1 Like

Yes, I missed that one somehow! Thank you guys for been so helpfull, now it works correctly.

2 Likes