Metaegis
(Meta)
July 7, 2022, 11:55am
#1
I have tried multiple ways to get around this issue but no luck.
local player = workspace.Player
local hitbox = script.Parent
script.Parent.Touched:Connect(function(P)
print("Touch detected.")
if P.Parent == workspace.EnemyProjectiles then
print("Death.")
local newPlayer = player:Clone()
player:Destroy()
script.Death:Play()
wait(3)
newPlayer.Parent = workspace
end
end)
The prints do not run at all.
hitbox is a welded part, the projectiles are anchored parts that use cframe to move.
Any idea why this issue is happening?
Can we see a screenshot of the explorer.
Are you moving them locally or on the sever
Metaegis
(Meta)
July 7, 2022, 11:59am
#5
Im moving them via a localscript.
That’s the problem. If you are moving them on the client the sever doesn’t know that their in their new position therefore a Server script won’t detect the hit
Metaegis
(Meta)
July 7, 2022, 12:01pm
#7
Well… is there any ways to get around this using clientside?
Since im using renderstepped and a server movement system could result in jittery movement i would like to know if theres a way.
You can probably use a RemoteFunction to get the client sided position of the part. However, that doesn’t sound very safe.
Like @FunAsiK said if you use:
FunAsiK:
SetNetworkOwner()
When moving in the server so it’s not jittery
FunAsiK
(FunAsiK)
July 7, 2022, 12:04pm
#9
Use SetNetworkOwner() on the projectiles.
Metaegis
(Meta)
July 7, 2022, 12:07pm
#10
Would that work on anchored parts?
FunAsiK
(FunAsiK)
July 7, 2022, 12:08pm
#11
No. SetNetworkOwner() does not work on anchored parts.
Metaegis
(Meta)
July 7, 2022, 12:17pm
#13
Well… im using anchored parts, since im out of ideas im assuming that i have to create projectiles via a script.
Other than that i have a few questions: do RemoteEvents affect performance,
Is there a way to move a projectile via physics without it falling down?
FunAsiK
(FunAsiK)
July 7, 2022, 12:40pm
#14
How would I do it.
If projectile not a model, then make it as a model and set PrimaryPart to projectile.
Create a fake part.
local part = Instance.new("Part")
part.Name = "FakePart"
part.CanCollide = false
part.Anchored = true
part.Size = Vector3.one
part.Transparency = 1
part.CFrame = CFrame.new()
part.Parent = projectile_model
Add Align Position and Align Orientation to make movement smooth.
local projectile_attachment = Instance.new("Attachment", projectile_model.PrimaryPart)
projectile_attachment.Name = "ProjectileAttachment"
local fake_part_attachment = Instance.new("Attachment", part)
fake_part_attachment.Name = "FakePartAttachment"
local align_pos = Instance.new("AlignPosition", projectile_model.PrimaryPart)
align_pos.Attachment0 = projectile_attachment
align_pos.Attachment1 = fake_part_attachment
align_pos.MaxForce = 1e11
align_pos.MaxVelocity = 100
align_pos.Responsiveness = 15
local align_orientation = Instance.new("AlignOrientation", projectile_model.PrimaryPart)
align_orientation.Attachment0 = projectile_attachment
align_orientation.Attachment1 = fake_part_attachment
align_orientation.MaxTorque = 1e11
align_orientation.MaxAngularVelocity = 100
align_orientation.Responsiveness = 15
Update the CFrame of the FakePart in RunService.RenderStep or while true do.
while true do
part.CFrame = -- your's CFrame.
wait()
end
And now you can use SetNetworkOwner().
workspace:WaitForChild("ProjectileModel").PrimaryPart:SetNetworkOwner(nil)
system
(system)
Closed
April 2, 2024, 2:07pm
#15
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.