local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Shooting = ReplicatedStorage.RemoteEvent:WaitForChild("Shooting")
Shooting.OnServerEvent:Connect(function(player,Position,Direction,Weapon)
local Bullets = ReplicatedStorage.Bullets[Weapon].Bullet:Clone()
Bullets.Parent = workspace
Bullets.CFrame = CFrame.new(Position)
local BodVel = Instance.new("BodyVelocity",Bullets)
end)```
```lua
--ShootingPart is the muzzle
RS.RemoteEvent.Shooting:FireServer(framework.viewmodel.ShootingPart.Position,framework.viewmodel.ShootingPart.CFrame.LookVector,framework.viewmodel.Name)
--Value passed
#FastCast wont visualize
1 messages · Page 1 of 1 (latest)
worldpos of what?
look at the video, the bullets just dont want to spawn at the exact position
idk about viewmodela but im pretty sure you cant get a world pos of it unless its actually attached to the player and not an actual ViewPortFrame (ive seen some do that), maybe try to set the position of the bullet on the LookVector of the player and add some offset position values to it
Nah im not using viewport
@untold saffron
💔
The bullets
seem to always
spawn below me
undermap
@proud arch sry to ping, u mind to help?
Bullets.Position = Position
Youre applying Position to CFrame which is both position and orientation.
And shit.
position is a vector3
nope, position is vector3
Bullets.CFrame = Bullets.CFrame + (Position * 1)
~~Make an attachment on the muzzle, use .WorldCFrame to get the world position of where the bullet should come from
No need to over complicate it~~
Oh unless you're trying to get bullet spawn position from the server
I think this is more of a situation where you need to rethink how you handle this
When I made an FPS system, I used FastCast to cast a cosmetic bullet on the client. I'd tell the server where I think I was aiming at.
The server would fire an invisible bullet to do actual hit detection. The server would tell everyone else that the shot happened
All other clients create their own cosmetic bullet
@proud arch , FastCast wont visualize it.
it absolutely will
Let me send u the vid
https://etithespir.it/FastCastAPIDocs/fastcast-objects/fcbehavior/
CosmeticBulletTemplate
CosmeticBulletContainer
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Shooting = ReplicatedStorage.RemoteEvent:WaitForChild("Shooting")
local FastCast = require(ReplicatedStorage.Modules.FastCastRedux)
local caster = FastCast.new()
caster.VisualizeCasts = true
Shooting.OnServerEvent:Connect(function(player,Pos,Direction,Weapon,Camera)
local Position = Pos
local Direction = Direction
caster:Fire(Position,Direction,10)
end)```
FastCast wont visualize
- Create FastCastBehavior object
- Pass to
Firefunction after velocity.
Oh yea my bad, I do caster.VisualizeCasts = true not FastCast.VisualizeCasts = true