Roblox Studio Tutorial | Laser Gun Game Scripting

Published: 23 March 2023
on channel: Funzone
238
2

Roblox Studio Tutorial | Laser Gun Game Scripting
Join Our Roblox Group : https://bit.ly/320klfG
Check out my game FunZone Mining at https://bit.ly/2UbpDnC


Roblox Studio Gameplay Mechanics Hit Detection with Lasers
Use raycasting and hit detection to shoot lasers from a blaster.
In this course, you’ll learn how to cast a laser from the blaster in Creating Player Tools and detect whether or not it hits a player.
Raycasting to Find Collisions
Raycasting creates an invisible ray from a start position towards a given direction with a defined length.
If the ray collides with objects or terrain in its path, it will return information on the collision such as the position and the object it collided with.
Finding the Mouse Location
Before a laser can be shot, you must first know where the player is aiming.
This can be found by raycasting from the player’s 2D mouse location on the screen directly forwards from the camera into the game world.
The ray will collide with whatever the player is aiming at with the mouse.
Open the ToolController script inside the Blaster tool from previous video Creating Player Tools.
If you haven’t completed that course yet you can download the Blaster model and insert it into StarterPack.

#Roblox
#RobloxStudio
#RobloxStudioTutorial
#robloxcoding
#script
#scripting.


Watch video Roblox Studio Tutorial | Laser Gun Game Scripting online without registration, duration hours minute second in high quality. This video was added by user Funzone 23 March 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 238 once and liked it 2 people.