You could send it as a GIF, MP4, or Mov file
But this is unrelated to the main topic
You could send it as a GIF, MP4, or Mov file
But this is unrelated to the main topic
I am trying to share a video on what is happening, because the issue is really weird.
Basically, when I first spawn in, the bullets spawn at the gunâs barrel, once I move to a different spot, the bullet still fires at the same spot as before, even though I moved the gunâs barrel to a different spot.
Is velocity
a vector? Or is it a number?
Itâs a number (this is here to extend character length so I can post reply)
What I think is going on here, is your setting the current cframe of the bullet equal to itâs own cframe, times *= CFrame.new(0,0 -velocity * (dt * 60))
. Then, the next frame, you set it to itâs own cframe times *= CFrame.new(0,0 -velocity * (dt * 60))
. If that runs every frame, then the bullet is going to go insanely fast.
I donât think that causes the issue right now, but I did notice that the bullet goes very fast. The issue I am experiencing is this:
Also how can I fix the issue you pointed out?
It is pretty much deprecated (it says it exists only for the sake of backwards compatibility)
Do I do what I said I could, or should I figure out a better idea to update the bullet spawning position?
I did a quick check, and the bullet doesnât spawn where the barrel is, also please go look at the topic that I linked literally at the top of this topic to get a reference of what I am trying to do, only if you havenât already.
I am also trying to figure out a logic statement to adjust the position of the bullet, but I canât when the bullet spawns at the center of your screen.
Looking at the tutorial, did you mean to multiply the Z
Vector by dt
multiplied by 60�
Bullet.CFrame = CFrame.new(0, 0, -velocity * dt)
Not sure what you mean by this, the position will change every frame the RenderStepped
event is called?
The bullet moves fine no need to change that, just the bullet spawns in one place, and itâs not even the first position of the barrel, it just spawns at the center of your screen, then moves like normal. When I move, the bullet still spawns in that same position, I canât make an if statement if the bullet never touches the barrel, so I am kind of stumped.
(Replying to this a day later whoops)
So the error lies in these instances then when the Bullet is first cast:
--GunBarrel is 1 of the GunComponets that I'm assuming is a BasePart
local Bullet = Instance.new("Part")
Bullet.Size = Vector3.new(1,1,5)
Bullet.Anchored = true
Bullet.CanCollide = false
Bullet.Color = Color3.new(255,255,255)
Bullet.Material = Enum.Material.Neon
Bullet.Parent = workspace
--Bullet.CFrame = CFrame.new(GunBarrel.Position, endposition)
Bullet.Position = Vector3.new(math.random(-50, 50), 5, math.random(-50, 50))
What about try setting the Bulletâs Position relative a random position?
we can see the second argument is âendpositionâ, try endposition.Position.
Weâve already established that there was a Mouse Instance being passed over to the module, so I changed that to Mouse.Hit.Position
for the Module Script to detect for assigning the endPosition
variable
The new issue here is that once 1 bullet spawns in, any others would stay in that same place and wouldnât change position
After talking to the creator of the framework, I fixed most of the issues, and now the bullet kind of spawn in. It spawns at the center of the screen, and is normal and works, until you shoot down, once you do that the angles break completely. The bullet still doesnât spawn at the barrel.
Did you try using math.random()
to check if the bullet will spawn in random directions?
I just did, sorry for the late reply, I was working on another game.
you did mistake, where i told /\
Did it like this.
game:GetService("RunService").Heartbeat:Connect(function(dt)
if IsPlayerHoldingMouse then
if CanFire then
CanFire = false
MainModule.cast(GunModel, game.Players.LocalPlayer:GetMouse().Hit.p, 60) --Now script sends mouse.Hit.Position.
wait(FireDelay)
CanFire = true
end
end
end)
I understood that you already fixed that thing, good luck with project.
I just tried your method, and I got a little syntax error:
The [
after GunModel
has red line under it.
No, i said that you already fixed, donât use mine thing. Read last lines of my reply