How to reproduce projectiles in Workshop

[ How to create projectiles without using the Workshop extension ]

Is there a way to reproduce projectiles without using the Workshop extension?
Do you use a variable for the projectile’s direction of travel to make the projectile move forward?
However, I can’t create a mechanism where it disappears when it hits a wall.
Someone please tell me.

Edit: I wanted to recreate Sombra’s old Translocator.
If I could understand how it works, it wouldn’t be such a pain to put in the effort.

1 Like

It depends if it is a linear projectile with travel time and speed invovled or an arching projectile with gravity and launching angle. Though for the former you can savely define a hit collision with ray cast in a forward direction, for the later it’s a bit more work, you may need detection for forward, down direction for the ground otherwise you don’t mind letting it fall through and after a specific time delete the projectile and upwards for anything hitting in the air like roofs etc.

Edit: Well the workshop extension just addds more visuals, we have Create Projectile, Create Homing Projectile and Create Projectile Effect actions, detection on the former two are already inbuilt, you just need to fill in values for the appreciated paramters. The last method just creates the visual of predefined projectiles from other heroes, but we can apply custom reevaluatable parameters like it’s position and travel direction or facing direction, but also requires custom implementation of hit detection with ray casts again, for that its not built-in.

2 Likes

Also builtin Create Projectile actions are more optimized than making everything in workshop because workshop’s virtual machine execute scripts with a limited performance versus a builtin running directly in game engine.

2 Likes

The capacity of the extension is screaming.

(Although it is not always necessary.)

1 Like

This may help but I’m way outta practice with the workshop

Add https:// before the URL, sorry couldn’t Hyperlink

workshop.codes/wiki/articles/create-projectile

Good luck.

2 Likes

I would like to avoid using “Create Projectile” action as much as possible.

You actually want to use it as much as possible, it creates less overheat in the long run, though the projectile system provided may not seem to work 100%, but gives you more space. The extension just adds the visuals, depending on your over all size of your game increaes the effect limit to 256. Be aware you would also need 256 calculations for those as projectiles, and what is with other visuals in your game mode? Both ways have their downs and ups, for example using the raw way gives you more control over the hit detection and you can reference better through victim and attacker, since we can’t reference custom projectiles yet.

You can do this with the “Create Effect” function and try to reproduce the physics, movement and bounce of the projectile. It will be an incredibly difficult task, but it can be done. I myself was creating a rework for Moira’s orb, in which she could damage/heal several allies and enemies at the same time (instead of just 1, and obviously costing more orb charge), but when I got to the creation part the movement had several problems, sometimes the raycasts don’t work the way I want, there is no way to detect collision between the effect created by the “Create Effect” function, so I ended up choosing not to use this method. An alternative was to spawn a dummy bot, with the wrecking ball in ball mode, make it invisible, change its gravity to very low and apply impulses to it. In this case, you can even detect if the Rat takes damage, but it costs a Bot player slot.