- Home /
move the ball randomly in unity android
Hello there,
I am a rookie programmer & looking fwd to improve my programming skills.....i need some support from established programmers like you guys.
Well, i am looking to build some sort of android game in which an enemy ball should randomly move in curtain rectangular space & if its hit the player ball it should loose one of its life. pls help me in this case.
Thanks in advance
Answer by Berenger · Jun 11, 2012 at 03:36 PM
If the issue is the collision detection, take a look at OnCollisionXXX functions.
If you want help for the ball rolling, I've never tried but I suppose it's done with a rigidbody, AddTorque and a very high friction on the physique material.
ghostreddy : does it work correctly if i add some waypoints(to move the sphere around the level in +z axis) around and add rigidbody as you suggested?
$$anonymous$$e : Comments dude, comments !
If you have waypoints, no need to use physics (so no rigidbody). You'll have to do the rotation yourself.
ghosteddy : $$anonymous$$gest me the right way to move a sphere randomly in curtain area.
$$anonymous$$e : You need to consider the movement appart from the target picking.
ghostreddy : consider movement? could you pls elaborate it ?
$$anonymous$$e : I see you have trouble getting how comments works :p
There is the movement (getting from point A to point B) and how to choose point B.
Answer by You! · Jun 12, 2012 at 04:17 PM
This question has already been answered.
Go to http://answers.unity3d.com/questions/23010/ai-wandering-script.html
...and if you need something to tell the ball to move forward, use
http://unity3dtutorial.com/unity-3d-tutorials/dealing-with-directions-movement-in-unity-3/
Your answer
Follow this Question
Related Questions
Android OnMouseDown character movement 2 Answers
Touch Input in Android... 1 Answer
Error text from google game services 0 Answers
Mobile Joystick - How to increase the touch area 0 Answers
Uniform variable fails on the android 0 Answers