Answered by
4 years ago Edited 4 years ago
I answered this question a long time ago on the developer forum, so here's the gist:
You use a BodyVelocity with the MaxForce on each axis set to math.huge
and set the Velocity property to the current MoveDirection of their Humanoid (for this to work easily with mobile / console users too) multiplied by a desired speed (I used 16) to get the velocity. You just need to integrate diving / surfacing by using UserInputService to detect inputs and apply to the velocity, like:
04 | UserInputService.InputBegan:Connect( function (input) |
05 | if input.KeyCode = = Enum.KeyCode.SpaceBar then |
07 | elseif input.KeyCode = = Enum.KeyCode.LeftShift then |
15 | BodyVel.Velocity = TargetedVelocity + Vector 3. new( 0 , y, 0 ) |
Doing this will give you the same results I did in this place long ago and even Flood Escape 2's