#Help with gun

1 messages · Page 1 of 1 (latest)

stray pilot
#

So I'm making a gun that uses raycasting (like every other gun) and I want to add accuracy and idk how. I've tried adding a vector3 to the ray direction but it didn't work

plush gale
#

thats probably why it didn't work hehe

#

Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, in Euclid's Elements, it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are Euclidean spaces of any positive integer dimension n, which are called Euclidean n-spaces when one wants to specify their dimen...

#

In geometry, a three-dimensional space (3D space, 3-space or, rarely, tri-dimensional space) is a mathematical space in which three values (coordinates) are required to determine the position of a point. Most commonly, it is the three-dimensional Euclidean space, that is, the Euclidean space of dimension three, which models physical space. More ...

stray pilot
#

uhhh

#

then how do I do it if I can't add the vector3 😭

#

this is what i've tried

#

local Offset = Vector3.new(
math.random(-Accuracy, Accuracy),
math.random(-Accuracy, Accuracy),
math.random(-Accuracy, Accuracy)
)

local Params = RaycastParams.new()
Params.FilterType = Enum.RaycastFilterType.Exclude
Params.FilterDescendantsInstances = {Char, Gun}
local Direction = (Mouse.Hit.Position-Origin.Position).Unit
local FinalAim = (Direction+Offset).Unit
local RayCast = workspace:Raycast(Origin.Position, FinalAim*Range, Params)

plush gale
#

what is value of accuracy

stray pilot
#

0.03

#

I've tried with higher values but didn't work either

#

and the Range is 500

plush gale
#

do you have position and direction backwards?

plush gale
#

do you have direction where the position should be and vica versa?

stray pilot
#

uhh no

plush gale
#

how do you know? thonkoof

stray pilot
#

I don't 🙂

plush gale
#

😨

plush gale
plush gale
stray pilot
#

so it might be the way I make the bullet visible? idk

plush gale