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
- State Management: We’ll use a Boolean variable, let’s call it
bIsMoving
, to track whether the conveyor is currently active or stopped.
- 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.
- 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
- In the Content Browser, right-click and select Blueprint Class.
- Choose Actor as the parent class and name your Blueprint something like
BP_TimedConveyor
.
- Double-click to open the Blueprint editor.
Step 2: Adding Components
In the Components panel, add the following:
- 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).
- 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:
Step 3: Creating the Variables
In the My Blueprint panel, create the following variables:
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).
MoveSpeed
- Variable Type: Float
- Purpose: How fast the objects should move.
- Default Value:
100.0
(adjust as needed).
MoveDuration
- Variable Type: Float
- Purpose: How long the belt moves for.
- Default Value:
8.0
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.
- Right-click in the Event Graph and select Add Custom Event…. Name it
StartMoving
.
- Do it again and create another event named
StopMoving
.
Now, wire them up like this:
-
StartMoving Event:
- Drag out a
Set bIsMoving
node and check the box to set it to true.
- From its execution pin, add a Set Timer by Function Name node.
- 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:
- Drag out a
Set bIsMoving
node and leave the box unchecked to set it to false.
- From its execution pin, add another Set Timer by Function Name node.
- 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.
- Find the Event Tick node.
- Drag off its execution pin and add a Branch node. Connect
bIsMoving
to the Condition pin.
- From the True pin of the Branch, get a reference to your
MoveVolume
component.
- Drag off the
MoveVolume
pin and find the Get Overlapping Actors node. This will return an array of all actors currently inside the box.
- Drag off the Out Actors array pin and add a For Each Loop node.
- From the Loop Body execution pin of the loop, add an Add Actor World Offset node.
- 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.
- 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.
- Find the Event BeginPlay node.
- From its execution pin, call your
StartMoving
function.
Final Check and Object Configuration
- Compile and Save your Blueprint.
- Drag
BP_TimedConveyor
into your level.
- 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.