How do I make something like this

I want to make a part that moves and rolls like the video below, but I don’t know how.

The video:


Any help is appreciated, thanks.

5 Likes

When the player touches the ball,tag it as the controller. Now you will check the move direction of the players humanoid every second and add the velocity in that direction to the ball.

1 Like

How? I Don’t Know where those properties is. or Make the script for that.

1 Like

The simplest way to make that without making the ball move automaticlly is this:

  1. Making an anchored ball and changing it’s CustomPhysicalProperties to fit your preference
  2. Adding script inside that ball that uses the Touched event to unanchor.
1 Like

I want to make that ball rolling like the video above, I don’t know how they did.

1 Like

Well it should roll with that previous method but slowly so you can do it with Humanoids and a script faster.

  1. Make a Model which includes the Ball as the PrimaryPart and Humanoid in it
  2. Change the Humanoid WalkSpeed property.
  3. Put a Script inside the Model which will be used to move the ball with it.
  4. Use Humanoid:MoveTo(position to go) to move the ball around.

The ball should move around.

They did that rolling script without humanoid.

Then the first method. You just need to mess with the CustomPhysicalProperties in the Properties and the ball should roll when you walk into it. (If you want to do it without scripts)

Edit: You can also mess with CollisionGroups to make invisible walls so the ball can only move around in specific areas.
Edit2: (also i didn’t notice that you said script)

The ball that I have has only two parts, the overlay and the sphere. the sphere part has a rolling sound, so I have to put humanoid in the model and change the volume’s sound when the player moves the ball around?

Yes. Don’t forget to also weld these parts. I recommend RigEdit Lite plugin for that.

The overlay is welded, I used the weld constraint to weld them, so, Where do I put the Humanoid:MoveTo() in the script.

When the player touches the ball you can use it to move the ball around.

Give me an example script, to roll the ball when you touch the ball.

ball.Touched:Connect(function()
    script.Parent.Humanoid:MoveTo(Waypoint.Position)
end)

You can use waypoints (parts in a folder) in a for i,v loop to make scripting it easier
Edit: i meant a for i=0, number loop*

Then How do I make waypoints? to make scripting easier?

I already said that but I can explain it. Make parts in a folder named Waypoints and use a for i=0, #Waypoints:GetChildren()) loop. And to go to waypoints in order just do this:

Edit: You need to name your waypoints using numbers.

ball.Humanoid:MoveTo(Waypoints:FindFirstChild(i))
ball.Humanoid.MoveToFinished:Wait()

But, I want the ball rolling on player’s facing direction.

Oooooh. Well you can use CFrame.LookVector. When you get player’s character from the Touched event to use it like this:

local HRP = Character.PrimaryPart
ball.Humanoid:MoveTo(HRP.Position + HRP.CFrame.LookVector * STUD_DISTANCE)

Can I use the number value to replace the STUD_DISTANCE?

Yes you can use it to replace the STUD_DISTANCE.