My new game is based on being inside a ball and rolling around inside of it. I’ve managed to spawn myself inside a ball yet it doesn’t feel smooth compared to another ball game:
CFrames have a property called LookVector which is a Vector3 (unit vector) that points in the direction for forward face of the object.
Dont take my word for it but my guess is that super blocky ball messed with the PlayerModule to get their control system. No idea how you’d go about doing that.
I made a game where you control a snowball that just uses body forces. If the force is week enough the player wont be able to move upward. To do it i made the player not collide, Massless, and lowered density as low as possible, then welded to the ball. Then i made a bodyForce, parented it to the ball and set the force equal to the player camera’s lookvector * some amount to magnify the force to my liking. If youd like to check it out let me know and ill have to show you because you need to trigger the snowball effect and its kinda hidden.
K its getting late so youll have to play on ur own.
To trigger the event walk on the planks close to where you spawn.
I need to correct myself when i said i just made the force small to keep players from floating. This was not how i programmed it. I use a body force but i multiple the Force property with Vector3.new(1,0,1) so like this
bF.Force = bF.Force * Vector3.new(1,0,1).
This cancels any upward force incase the LookVector is pointing up
Personally I wouldn’t roll the ball as you can’t really control acceleration and direction change all that well. The ball might start sliding if you add too much angular velocity.
So, I recommend switching to LinearVelocity. There you can change the MaxForce(maximum acceleration) and Responsiveness(Maximum jerk) and you can directly control the balls Velocity directly. Also, you can set the balls Friction to something high too that will make it roll
LinearVelocity is a constraint. Constraints need attachments.
So to start of you need an attachment. You don’t have to create a new one (If the balls network ownership is owned by the client that is) you can just take one of the attachments that are in the Body of the character e.g. RootRigAttachment
Then setup the LinearVelocity. You can create it via script then parent it to the ball. Keep a reference of the LinearVelocity. Make sure the Relative to is set to world as the attachment will be spinning around.
MaxForce is Maximum Acceleration. A higher value and the velocity will be quicker to reach the target.
Responsiveness is Maximum Jerk. It represents how fast the acceleration can be applied.
The rest is just the same as BodyVelocity. But instead with LinearVelocity.
LinearVelocity also provides some extra features that BodyVelocity does not. VelocityConstraintMode allows us to only apply forces in a specific direction. For example maybe we only want the Ball to move along the ground. For that you need to set it to Enum.VelocityConstraintMode.Plane
The Primary axis and Secondary axis are simply (1,0,0) and (0,0,1) note: you can see that we don’t want to apply the force in the Y Axis.
Then we can finally start rolling the ball. We can get the RelativeForward d ddairection of the Camera by doing this.