Key Features
Motion and Physics
- Speed adjustment (pixels per second)
- Motion angle setting (in degrees, 0 = right, 90 = down)
- Gravity (downward pull)
- Behavior on/off
Collision Detection
- Continuous collision detection (CCD) for high-speed objects
- Does not “fly through” solid objects even at high speeds
- Works stably at low FPS
- Automatic ejection when stuck
Bounces
- Enable/disable bounces from solid objects
- Maximum number of bounces (0 = infinite)
- Speed multiplier after bounce (e.g., 0.8 = after each bounce, the speed decreases to 80% of the previous speed)
- Enable/disable slowdown on bounce (if disabled, the speed does not change after a bounce)
Solid collision handling
- Stop on collision (optional)
- Events on collision with a solid object
- Filtering by solid object tags:
- “Inclusive” mode - collide only with objects with specified tags
- “Exclusive” mode - ignore objects with specified tags
- You can add multiple tags separated by spaces
- Tags accumulate with successive calls
Control via events
Conditions:
- Compare speed - Compare current speed
- On hit solid - Event when hitting a solid
- On bounce - Event when bouncing
- Compare angle - Compare current angle
- Compare bounce count - Compare bounce counter
- Is moving - Check for movement
Actions:
- Set speed - Set speed
- Set angle - Set angle
- Set gravity - Set gravity
- Set stop on solid - Enable/disable stopping on collision
- Set enable bounce - Enable/disable bounces
- Set max bounces - Set maximum number of bounces
- Set bounce speed factor - Set bounce speed factor (e.g., 0.8 = after each bounce, the speed is multiplied by 0.8)
- Set enable bounce slowdown - Enable/disable bounce slowdown (if disabled, the speed factor is not applied)
- Set enabled - Enable/disable behavior
- Launch - Launch projectile (reset bounce counter)
- Bounce off object - Manual bounce off any object (not intended for high speeds)
- Set solid collision filter - Set tag filter for Solid objects
Expressions:
- Speed - Current speed
- Angle - Current angle
- Gravity - Current gravity
- BounceCount - Bounce counter
- VelocityX - X speed component
- VelocityY - Y speed component
Important points
- Always use solid objects for reliable collision detection. Non-solid objects may not be detected at high speeds.
- Manual bounce (Bounce off object action) is not intended for use at high speeds, as it does not use continuous collision detection.
- Tag filtering only works with objects that have Solid behavior.
- Bounce slowdown: if Enable bounce slowdown is enabled, the speed is multiplied by the Bounce speed factor after each bounce. For example, with a multiplier of 0.8 and an initial speed of 100: after 1 bounce = 80, after 2 = 64, after 3 = 51.2, etc. If slowdown is disabled, the speed does not change after bounces.
Examples of use
1. Bullets in shooters - accurate hits even at high speeds
2. Gravity-affected projectiles - artillery, grenades, balls
3. Bouncing projectiles - ricochets off walls, laser reflections
4. Collision filtering:
- Bullets passing through certain materials (ignore the “glass” tag)
- Projectiles that only hit certain types of enemies (only the “enemy” tag)
- Friendly fire that does not hit allies (ignore the “friendly” tag)
Added a new expression, LastHitObjectUID, to refer to the solid object with which the collision occurred.