Shooting Tutorial in Unity3d- Raycast Collision @SRCoder
Shooting Tutorial in Unity3d- Raycast Collision  @SRCoder
Uploaded March 2019 | Updated September 2026, 1 week ago
One of the toughest parts of this method is detecting the collisions. In this tutorial we script the raycast checking using the newest non-allocating raycast hit detection for fast an accurate hit detection.
We also put it into practice with a simple particle system effect to show the hits.
Stay tunes for more in the series when we look at ways to make this code much more efficient with object pooling.

Apologies!! Bug fix needed!
The second line of the CheckHit() function should read:
float dist = Vector3.Distance(lastPosition, transform.position);

I accidentally used transform.forward instead..... Sorry!
It's fixed in my next vid on Object Pooling
Shooting Tutorial in Unity3d- Raycast CollisionUnity Multiplayer Tutorial with PUN: Part 6-  Quit and Mouse lockGodot Top Down Tutorial Part 5: Bullets and GunsMy Game Jam TimelapseConstruct 2 Space INvader Tutorial 4Lesson 6- What if.....?Godot 4.1: Parallax BackgroundsSpaceJourney ShowcaseGodot Asteroids Part 6: SignalsSo you wanna learn Unity?MLAPI Tutorial: Part 7- Play Over NetworkMLAPI Tutorial: Part 2-  Networked Movement
SRCoder |

Shooting Tutorial in Unity3d- Raycast Collision

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER