Block delete on hit

Movescript

while true do
wait()
for i= 1, 50 do
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,0,-0.6)
wait()
end

end

Problem is the physics system is what gets .Touched. Since neither is affected by physics it won’t fire.

idk another way to, lol. any ideas?

what is the purpose of these moving parts? You will most likely need a physics mover of some sort.

1 Like

The flying part, when in contact with humanoid, kills them. but I don’t want the parts to be flying off the map

One of the simplest solutions, is just to add a physics mover but add them to debris service so they time out. Depending on speed they might still fly out of the map, but get cleaned up.

edit: :man_facepalming:Using a physics mover means they are unanchored and your original solution works.

Apparently I am wrong. You CAN cframe them and they will detect a hit.
@tlr22 has it correct, the part’s just can’t be anchored.

So why are the parts flying around, are the some projectile, like a bullet?

yes actually, so I will try unachoring

We’re close! the only problem now, is the bullets fall to the ground instead of moving straight. any ideas?

You can use an ‘alignPosition’ object, to keep the part at a particular position.
Instead of applying the cframe to the bullet, just apply the cframe.Position to the alignPosition

And add a ‘alignOrientation’ and apply the cframe to the alignorientation.CFrame

You will need to read up on them, as they have 2 different modes on how they work.

However… if you want something a bit simpler, that ‘might’ work for your needs. If you are just wanting to make sure the bullet does not leave the map, you can set them to be anchored again, but instead of checking for collision, jsut check the .Magnitde of how far they are from the center of the map, if they get so far away, delete them.

And again @tlr22 has a good idea, add them to Debris, so after so many seconds, they will be deleted

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.