Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make sticky projectiles work?

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?

2 comments

0

wot the "but is a little bit behind" look like xd is it in front of the wall or inside the wall

0

it means it anchors before its supposed to

1 answer

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

1 comment

0

Was about to answer this. Chur mate, beat me to it.

This discussion is preserved as it was. New answers, comments, and votes are closed.