The Projectile Launcher does not shoot straight where the crosshair is. How do I fix that? (Screen Issue Obviously)
You can start a raycast from your head pointing directly forwards, get the position it lands at and subtract it from your projectile launcher,'s position this will create a direction that you can use to shoot the projectile towards.
If you want picture feel free to ask, I’ll send them when I’m able.
Please send pictures, I need the help too. Lol.
Sure, here’s an image from a system I quickly whipped up.
This effectively just fires the projectile launcher in the direction of the object you’re looking at.
If nothing is found, it will just shoot straight forward. However at very close distances it will look like the projectile launcher is shooting to the side or even backwards. That should only happen if your face planting a wall though.
Hope this helps!
Doesn’t this method just shoot in the forward direction of your camera if your on screen and the forward of the gun handle if your on VR?
Unless I’m mistaken, but I think shooting in the forward vector of the camera will still result in an offset from where the crosshair is.
In gun handle there’s get firing direction chip and it makes projectile go towards the crosshair and it works even if projectile launcher rotation/position isn’t perfectly aligned with gun handle
Thanks! What if I want it to have a Spread for the gun? The Spread for the Gun Handle does not seem to work with the projectile launcher. How do I get that working?
To do that, you’ll have to control the spread inside the Projectile Launchers config menu.
I believe the method @Blue_di suggested would work when using the gun handle as it would pass along the modified forward vector (with spread) to the projectile launcher.
Weirdly enough, it does not. I’m using his method but im not getting the spread to work at all. It shoots precisely, but spread is extremely high.
But, I want to use the gun handles spread values. The Projectile Launchers spread isnt specific. I want there to be a Walking Scale to the Spread, a Crouch, and a Prone.
i know this might be sorta off topic, but while on the subject of gun handles and projectile launchers, could i get a photo of how to make it where when you shoot the weapon, it doesnt damage the player shooting? i had this question as its own topic, but the replies werent that great…
gun handle spread applies to crosshair not projectile
If you have projectile hit event receiver already set up, connect if player is local, attacking player to player, connect is local port to another if player is local chip, connect hit player to player and connect is not local to the rest of the system
Ok… if it doesn’t bother you, could I get a picture so I can just make sure I did everything right?
well, then how would I be able to apply a walking scale and crouching and prone scale to spread then?
I believe there are chips that check for all of these states as booleans. You can use these values to set the spread of the projectile launcher whenever it changes.
If you have PDB already set up, go to the last image
Place event definition, configure it and add properties:
hit player, type: player
Firing player, type: player
Damage, type: int
Place player definition board (empty)
Configure Player definition board and toggle active.
Edit Player definition board and place event receiver, configure it and set it to Projectile Hit Player, place event sender and set it to the event you made before, place collision data get player and connect everything like on the image. Edit out of the player definition board.
Place event receiver, set to the event you made and connect everything like on the image. It’ll also work if you connect firing player to the first if player is local and Hit Player to the second one