[Tutorial] Real-Time Particles in UPBGE 0.3+

Instructions are in the video description:

1 Like

Replying to this gentleman here:

import bpy

FRAME_START = 100
FRAME_END = 200

currentFrame = bpy.data.scenes["Scene"].frame_current
setFrame = bpy.data.scenes["Scene"].frame_set

if currentFrame < FRAME_START or currentFrame > FRAME_END:
    bpy.data.scenes["Scene"].frame_set(FRAME_START)
elif currentFrame >= FRAME_START and currentFrame < FRAME_END:
    setFrame((currentFrame + 1) % FRAME_END)
3 Likes

Thank you for the code :slight_smile:
ā€˜Use Viewport Renderā€™ must be checked else the particles are not visible.
ā€˜Use Viewport Renderā€™ must be unchecked if you want the replacemesh() code function to run.
A bit of a dilemma for those who want to use both!

I agree. If anyone has a better solution Iā€™ll be sure to edit the video description.

1 Like

I tried the code above for simulation nodes, and it does work for the simulation geometry nodes modifier.

However, it jumps back very briefly to frame 0 upon passing the FRAME_END variable which creates a small ā€œblipā€ in the simulation, thus resetting the simulation node animation. This isnā€™t what I want for particle simulation nodes in UPBGE, so is there a way for me to avoid the zero frame jump issue?

For me, I mapped the FRAME_START to an integer property and the FRAME_END is likewise mapped to an integer property. They work as expected except for that small snap back to frame 0. My aim is to get rid of that small ā€œsnapā€ or reset that is causing the simulation to jump back to frame 0.

Hi. Apologies for the late reply. I have no idea. I donā€™t really use UPBGE anymore. Sorry.