Hello there, so I have a problem i have after reworking my raycast weapons into using Fastcast, A great Module to use that allows you to make projectiles with raycasting, and I was reworking my weapons to use this, so most of the raycast code for it comes from the fastcast test weapon that was put in the fastcast thread that I stated in the thread above.
What happens when firing a weapon, the error given is this.
16:56:20.950 - Players.joshuasol.Backpack.AR15 RPH.Scripts.BackendScript:207: attempt to perform arithmetic on local 'Direction' (a userdata value)
(gif here to show it, mainly the output below.)
Where does this take place?
Firstly, Here’s the client script where the function fires into the server script where the fastcast ray is going to fire, and where the problem is specifically, on line 206.
What have i tried to debug the issue?
When I tried debugging the issue, I first went into the Client script where it fires to try and figure out FireDirection, as it most likely seems the same as the Direction portion in the serverside script. As I did this, i did
print(FireDirection,type(CFrame.new(FireDirection))), and this is what it gives me.
-2.85255028e-05, 0.0103102932, -0.999946833 userdata
so after this and it not really giving me much, i searched a bit on the magical item known as the “internet” to figure out that just like how the error gives me, I can’t do arithmetic on a C object. Now, the only other thing I can think up of to do when the problem occurs is to figure out what .Unit and .Direction should be, but I can’t figure it out this time because it’s the first time i’ve used fastcast.
What should I do here, and if anyone can, please help provide a solution to the problem? If anyone helps, thank you.