Author Topic: Event trigger - Ball on hit  (Read 1187 times)

I'm trying to make a basketball hoop, and I have a brick right below the ring where the ball would be scored through. I'm trying to have a trigger there to play a sound and eventually use it to make a working scoreboard. The problem is that the ball won't trigger the brick unless it is collided. When that happens the ball will obviously just bounce out instead of passing through the hoop. Is there a way to make it work by just passing through the brick? I'm fairly new to Blockland, and I tried looking around before posting a help topic about this.

Sorry, I meant to put ray-casted instead of collision. Even if I have ray-casting on and collision off, the ball still won't go through for some reason.

First of all, as far as I can figure out, balls are identical to any projectile, and projectiles use the ray casting flag for collision, not the collision flag.

There are 2 ways you can do this:

onProjectileHit> self> setRayCasting> off, then on again a second later

onProjectileHit> self> spawnProjectile> Basketball (with a little downward velocity to make it look realistic), and at the same time onProjectileHit> projectile> delete

I just realized, instead of making the detector spawn the projectile, you should probably put a named brick a few notches below the detector with raycasting turned off, and spawn the projectile from that.

Since the detector brick needs raycasting on, the basketball might glitch out as it exits the brick, or the spawned projectile might activate the detector again and give you an infinite basketball fountain.

Wow that's pretty clever, and yeah I didn't assume the balls were projectiles for some reason. I just tried the first option, and it didn't work. The second option is working pretty well, but yeah it looks a little clunky. I can't complain though. Which output parameter would give it downward force? and I'm assuming the bar to the right is the amount of force.


To your newer post: It actually didn't glitch out at all.. you can notice the tiny delay of spawning and the fact that it doesn't follow its momentum when going through the hoop, but when you have a net, that's what happens anyway.

The bar is actually the projectile's size, and the projectile's explosion is scaled equally. The 3 text boxes before the projectile type are the velocity, the last box of the 3 is up/down, make the number negative for down. The other 2 are horizontal. Set 2 of the values for diagonals.

The 3 text boxes AFTER the projectile type are randomizers. For example:

If you put a velocity of
  • [10] and randomize
  • [5] it can add or subtract 0 to 5 from the velocity, making it randomly go faster or slower.


If you make the velocity
  • [10] and randomize [5] [5]
  • it randomizes the horizontal direction instead.


If you make the randomizer bigger than the velocity, it can go backwards.

Oh god I didn't know that a 0 surrounded by square brackets made a bullet point. Why is the edit button gone. What have I done.

Yeah I was a bit confused on how to input that, but I get what you're saying. This helps a lot, thanks man!

in case it helps you read it
The bar is actually the projectile's size, and the projectile's explosion is scaled equally. The 3 text boxes before the projectile type are the velocity, the last box of the 3 is up/down, make the number negative for down. The other 2 are horizontal. Set 2 of the values for diagonals.

The 3 text boxes AFTER the projectile type are randomizers. For example:

If you put a velocity of [0] [0] [10] and randomize [0] [0] [5] it can add or subtract 0 to 5 from the velocity, making it randomly go faster or slower.

If you make the velocity [0] [0] [10] and randomize [5] [5] [0] it randomizes the horizontal direction instead.

If you make the randomizer bigger than the velocity, it can go backwards.
[nobbc][/nobbc] tags work wonders