This is a pretty complicated solution so it might not work right away but
I had a situation similar to this one day when i was messing around and it was for a ball with a click detector that i needed it to start going up and to the left when i clicked
the way i ended up doing it was using body velocity and making a child to a part i had created in the same script to do this i used
1 | local children = Instance.new( "BodyVelocity" , Part) |
to make the body velocity (it was a bit ganky at first but ended up working
the problem i ran into was that it was set to going up but i needed it to go up and to the left so i had to set the body velocity's x, y, z velocity to new values
i did this by putting right under it
1 | children.Velocity = Vector 3. new(- 10 , 10 , 0 ) |
and IT WORKED
so with my new found knowledge i used it to do the childish thing of making a noob start pissing into the sky the final code was
01 | local Click = script.Parent |
02 | local brick = script.Parent.Parent |
06 | function whenMouseClick() |
08 | Parts [ count ] = Instance.new( "Part" ,game.Workspace.AnthonysPlayground) |
09 | Parts [ count ] .Name = "Piss" ..count |
10 | Parts [ count ] .Color = Color 3. fromRGB( 164 , 168 , 50 ) |
11 | Parts [ count ] .Shape = Enum.PartType.Ball |
12 | Parts [ count ] .Size = Vector 3. new( 0.5 , 0.5 , 0.5 ) |
13 | Parts [ count ] .Position = brick.Position + Vector 3. new( 10 , 1 , 0 ) |
14 | local children = Instance.new( "BodyVelocity" , Parts [ count ] ) |
16 | children.Velocity = Vector 3. new(- 10 , 10 , 0 ) |
17 | print (Parts [ count ] .Name) |
22 | Click.MouseClick:connect(whenMouseClick) |
and it turned out pretty funny
Hope i helped and good luck on your project!