- Fastcast is broken when it’s in first person.
- I have recently used Fastcast because Roblox raycasting is kind of expensive these days…
- Fastcast is paired PartCache
Understandable, no further questions explained - Problem:
- Since I use ServerScript to handle any remote events from client scripts in tools, usually it’s fine, but this is a problem here. The mouse. When the player goes in first person, their mouse will lock inside the center of the screen. This is what a modern FPS should have. And problem 2 is that the bullet does not move where it’s intended like in the video
Apparently this is the source of the problem:
local function fire(player, Origin, Direction, Velocity, Drop)
rayParams.FilterDescendantsInstances = {player.Character}
local origin = Origin
local directionalCF = CFrame.new(Vector3.new(), Direction)
local direction = (directionalCF * CFrame.fromOrientation(0,0, rng:NextNumber(0, tau)) * CFrame.fromOrientation(math.rad(rng:NextNumber(bullet_property.bullet_min_spread, bullet_property.bullet_max_spread)), 0, 0)).LookVector
local mousedir = (Direction - Origin).Unit <-- This part is the problem
castBehavior.Acceleration = Vector3.new(Wind.X/2, Wind.Y/2 - 0.367 * Gravity - Drop * Gravity, Wind.Z)
caster:Fire(origin, direction, Velocity, castBehavior)
end
Since i think it’s either the Origin (aka gun muzzle worldPosition) or the Direction (aka mouse.hit.p). Any helps would be appreciated!
Also this is the bullet’s property btw
local bullet_property = {
bullet_gravity = Vector3.new(0, -workspace.Gravity, 0);
bullet_min_spread = 1;
bullet_max_spread = 5;
bullet_speed = 1000;
bullet_maxDist = 2500;
canPierce = true;
};