Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make sticky projectiles work?

Asked by 2 years ago

What I am trying to do is make a sticky launcher, however I am having trouble with making the stick feature be consistent. Here's an example: I shoot the sticky, and on the client the sticky is not stuck to an object, but is a little bit behind. However on the server the sticky looks like it should and is on the object. The way I make it stick is a simple .Touched which checks if the object has can collide on and is not a part of the character. Here is the code if you want it.

StickyClone.Touched:Connect(function(touchpart)
    if touchpart.CanCollide == true and not touchpart:IsDescendantOf(character) then
        StickyClone.Anchored = true
    end
end)

I don't know what i'm doing wrong, body velocities perhaps?

0
wot the "but is a little bit behind" look like xd is it in front of the wall or inside the wall BulletproofVast 1033 — 2y
0
it means it anchors before its supposed to munkuush 22 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

Figured it out by using a loop of raycasts with Velocity.Unit

0
Was about to answer this. Chur mate, beat me to it. radiant_Light203 1166 — 2y
Ad

Answer this question