Chocolate sauce? Could it be possible?

Good morning everyone, I have a problem right now where I want to continue with whatever project I am right now, but I am stuck in this place. I am stuck more because I have no clue about where to look for or where to start, so here it is.

  1. What do I want to achieve?
    I want to make some coding on my game that, in the programming code, is basically summoning what seems to be a snake with custom meshes in it that fall down and get in contact with a mesh or an area, and in turn it sticks to that mesh or area. The “snake” it would summon would be made with the mouse and holding click. I made a raw animation just so whoever sees this can get an idea

I want to make something like this. The triangle is of course the mouse
Banana spray

It’s really bad quality, I know, but it’s just so the idea gets seen.
In other words, I want to simulate chocolate sauce falling from above, so it looks like this image.

  1. What is the issue?
    I don’t know where to start, I don’t know what to do and I don’t know where to search. This type of problem is very specific, and there’s no way I would get some info on the forums because nobody is trying to make chocolate sauce

  2. What solutions have I tried so far?
    Look, the only place where I can get some info right now is the mouse article, but I have no idea where else can I get info. This is a very specific problem, i doubt someone had the same problem. And as I stated, I don’t know what to do

So yeah, I want to simulate sauce, and my name is fransauce, how ironic. I don’t want entire scripts made specifically for this, I mean I don’t mind but I’d rather do it myself with the “spaghetti code” I am making, or what seems to be spaghetti code. If I had to make something right now, I’d make a chain with one of the attachments of the rope, and make each part slowly fall down, but I’m clueless…

Any ideas?

3 Likes

I cant see the image you posted, so I am going to assume that you want to “draw” chocolate syrup over top of a scoop of icecream.

If I were to try and tackle this, I would probably add points as the player holds down their cursor, at mouse.Hit position, spacing each out by a certain amount by checking the magnitude between the current cursor position and the last point.

When each point is drawn, a part is drawn between the just drawn point and the last point. You could even draw a part from the last point to the cursor position until the next point is created, so it looks like its actually coming from the cursor.

Stop drawing points when the mouse button is released, and if the player starts holding the mouse click down again, just start a new table of points so it doesn’t draw a part to the last point of the previous drawing session.

3 Likes

The image was just an ice cream scoop with chocolate syrup on it. It doesn’t matter much, the other one is a gray gif of what I want to achieve.

The mouse.hit event is exactly what I needed, but it will take me some time to see if it works.

I will try to make a script that causes an event to be fired from a local script to the server on which some small balls will be put in the area on where I aim and click. If it does seem to work, I will try to connect it with a rope attachment or anything similar that can help make it work.

Right now, I have an idea of what to do, thanks to you, but I want to see if someone else responds, so I’ll leave it open. Once I make the script and I’m satisfied with it, I’ll mark a solution, or just ask some questions if I need some info.

Overall, this is just a big thank you.

2 Likes

You could try making a constant stream of spheres that don’t collide with one another but anchor when touching the ice cream.

1 Like

Ok, im going to do some necromancy to end this post once and for all, and help whoever needs it.

This is the result, it wasn’t complicated but I was clueless back a few months ago.

htps://imgur.com/a/mooqb9X

So what did I do?

I made a “put me” function that, when not firing, the function will repeat a wait loop until it starts firing, then, with the localplayer:getmouse(), I get the mouse.hit.p and if it’s being held down or up, when it’s down, a “firing” variable will be true, when it’s up, it’s just false. So, in exchange, it will make the function loop stop and go forward to the next actions.

local function ponme(i)
if firing == false then
	repeat 
		wait(0.1)
	until firing == true
end
--local esferin = ReplicatedStorage:FindFirstChild("esferin") (Ya sucede mas arriba)
local clonparent = workspace.Salsa
local clonposicion = mouse.hit.p
sauce:FireServer(esferin, clonparent, clonposicion, i, lol) 
wait()

end

then, the function will fire an event to the server with all the info it needs, the mouse.hit.p, the piece, the parent, the position, and the number of sauce.

And when does this function happen?

in a for loop, which will call the function every time it happens, when it’s not firing it will send another string to false (I dont use the firing string because otherwise it will always be true due to that wait loop on the function

Then, on the server script, a clone is made of the replicated storage which is put in the workspace on a platform touching an invisible wall that’s there for the mouse.hit.p to recognize as a place to touch, then it connects with small ropes that can’t separate well and casts a ray (which I previously didn’t know at all) to the ground below it, whitelisting the banana split and the baseplate which are the only ones it needs to stop at. So, the raycast gives me the coordinates on which it touches a part, and uses it as a final point. In the middle of this, a tween animation is being made pretending to be gravity, which will end at the baseplate (or the surface on which the banana is at), this tween uses the coordinates of the raycast for the X and Z but not the Y, the Y is a defined one I gave. So the tween animation plays, the raycast gets the position, the tween animation stops once it surpasses the raycastresult and it solidifies in the banana.

local function hazlasfisicasdesalsita(player, clon, parent, posicion, i, lol)
local ant = clon
if i > 0 then
	ant = workspace.Salsa[i]
end
local pa = ant:Clone()
pa.Name = i + 1
pa.Parent = parent --workspace.Salsa
pa.Position = posicion --mouse.hit.p
pa.RopeConstraint.Attachment0 = ant.Attachmentder
pa.RopeConstraint.Attachment1 = pa.Attachmentizq
if lol == false then
	ant.RopeConstraint.Attachment1 = nil
	pa.RopeConstraint.Attachment0 = nil
end
local gravedadfalsa = workspace:Raycast(posicion, direcciondelray, params)
local caida = tweenservice:Create(pa, tweeninfo, {Position = Vector3.new(gravedadfalsa.Position.X, 44.5, gravedadfalsa.Position.Z)})
caida:Play()
repeat wait() until pa.Position.Y < gravedadfalsa.Position.Y + 2
caida:Pause()

end

sauce.OnServerEvent:Connect(hazlasfisicasdesalsita)strong text

It was kind of hard for me, but now that I’ve learned a lot of tools and how to use them, things can get easier from now on. I want to thank you both because you both gave me useful info of what to do, and I honestly would’ve been stuck in a loop with zero knowledge on the matter, so thank you…

1 Like