- Home /
Whats the JavaScript for making a ball roll?
Plus how can i make it look really realistic? Like on a tilting marble game for iPod touch.
Thank you for the help!
Are you asking about moving the ball or how to tilt the board, so the ball will move?
just the ball roll and if the terrain moves it will effect the ball
Answer by user-6857 (google) · Jan 22, 2011 at 03:16 AM
im not wonderful at scripting but you could proboably use a transform.translate and a transform.rotate at the same time to get it rolling in the right direction. you might have to set the translate and rotate to different speeds to make it realistic. hope this helps some!
Answer by poncho · Jan 21, 2011 at 09:50 PM
the rigidbody physics for this works really much like you want, so there is no script for it, if you want to make a script you can change the ball position and rotate the ball towards the new position it will get, making the look like the ball is rolling anyway try to use the rigidbody first, if you are not convinced, try coding it like that hope this helps
Your answer
![](https://koobas.hobune.stream/wayback/20220613100451im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Rolling ball on many boxes causes bounce 0 Answers
ROLL a ball towards the player 1 Answer
Rolling ball Text error. Removes itself when played 0 Answers
Making a ball roll and keeping the axis? 2 Answers
Another Ball Rolling Game Question 1 Answer