Can somebody help me?
For some odd reason, the part highlighted in the picture (including all of the Blaster Model’s children) has its Position property not equal to the Position shown on the screen. It seems to be falling down.
For added clarity, the model is local to the player only.
RS.RenderStepped:Connect(function()
UIS.MouseBehavior = MBehavior
Char = workspace:WaitForChild(Player.Name)
Head = Char:WaitForChild("Head")
humanoid = Char:WaitForChild("Humanoid")
Camera = workspace.CurrentCamera
if Playing then
local CurrentTime = tick()
if humanoid.Health ~= 0 then
if humanoid.MoveDirection.Magnitude > 0 then
local bobble_X = math.cos(CurrentTime * 8)/8
local bobble_Y = math.abs(math.sin(CurrentTime * 8))/8
local tilt = CFrame.new()
if UIS:IsKeyDown("W") then tilt = tilt * CFrame.Angles(math.rad(-7),0,0)end
if UIS:IsKeyDown("S") then tilt = tilt * CFrame.Angles(math.rad(5),0,0)end
if UIS:IsKeyDown("A") then tilt = tilt * CFrame.Angles(0,0,math.rad(3))end
if UIS:IsKeyDown("D") then tilt = tilt * CFrame.Angles(0,0,math.rad(-3))end
bobble = bobble:Lerp(tilt + Vector3.new(bobble_X,bobble_Y,0),.05)
else
local bobble_X = math.cos(CurrentTime)/30
local bobble_Y = math.sin(CurrentTime)/10
bobble = bobble:Lerp(CFrame.new(bobble_X,bobble_Y,0),.1)
end
if UIS:IsMouseButtonPressed("MouseButton1") then
if CurrentTime - FireTick > GunProperties.FireRate then
FireTick = CurrentTime
local target = Mouse.Target
if target then
PlayerHit:FireServer(GunModel.Front.CFrame,Mouse.Hit,target)
end
end
end
GunCam.CFrame = Camera.CFrame * bobble
else
Playing = false
MBehavior = "Default"
GunModel:Destroy()
end
end
end)
--This is inside a server script
PlayerHit.OnServerEvent:connect(function(player,origin,hitPos,target)
local GunProperties = GunData[FindGun(player)]
if GunProperties.Type == "Laser" then
local RayPart = bulletTrail:Clone()
RayPart.Size = Vector3.new(.5,.5,(origin.Position - hitPos.Position).magnitude - 1)
print(origin.Y) --This part
RayPart.CFrame = origin:Lerp(hitPos,.5)
RayPart.Parent = workspace.temp
RayPart.BrickColor = player.TeamColor
Debris:AddItem(RayPart,5)
end
local Human
if target.Parent:FindFirstChild("Humanoid") then
Human = target.Parent.Humanoid
elseif target.Parent.Parent:FindFirstChild("Humanoid") then
Human = target.Parent.Parent.Humanoid
end
if Human then
local targetPlayer = Players:GetPlayerFromCharacter(Human.Parent)
if targetPlayer then
if player.Team ~= targetPlayer.Team then
if Human then
if Human.Health > 0 then
if target.Name == "Head" then
Human.Health = Human.Health - GunProperties.Damage
else
Human.Health = Human.Health - GunProperties.HeadShotDamage
end
if Human.Health < 0 then
local plrlevel = Levels[player.Name]
plrlevel.Value = plrlevel.Value + 1
end
end
end
end
end
else
local tempMark = bulletMark:Clone()
tempMark.CFrame = hitPos
tempMark.Parent = workspace.temp
Debris:AddItem(tempMark,5)
end
end)
Well it seems that it is not updating in the explorer but the thing is, it appears just fine on my screen so it should’ve updated (the model is local btw)
Definitely no cause you fire the remote event with the part’s position as a parameter on a client. Most likely
I just try it, and while I was jumping, I select the object again and the difference between the number that printed while I’m jumping and the number that is shown on the property tab aren’t really large.