I am currently working on a fun little physics game for the BGE contest and would like to know if I could have some help with scripting. Although I am familiar with it, I have no idea where to begin on this one.(Maybe, get the mouse’s rayposition?) I would like it so that when you click somewhere, a ball will set its linV towards that point. I saw this on the forum earlier but my search came up negative.
This is nearly what I want. since the game will not be using the x-axis, I was thinking that the script should tell the ball to get the y and z position of the click, and set the linv of the ball in that direction. Problem is, I don’t know how to write it.
Yes! It is! There is just one thing: how do I make it so that when you click in a certain direction, there is a gradual buildup of speed? Also, how do I make it so that gravity is applied unless you click somewhere in the +Z axis?
Come back, Blendenzo! You sound like you can fix this!:eyebrowlift:
An update: I made it so that the ball rotates behind a billboard plane, since the reflection of the ball would never change. Added more colors. Working on sounds.
Yes… it would be complicated but…DUH!!! Servo motion was exactly what I was asking for!! I can’t believe I didn’t think of that!
The z-axis thing isn’t really necessary, but there is something that is…
The paddles in the blend are deigned to knock the ball off course: the whole goal of the game is to keep the ball from going off screen. I need to make the force of the pedals a priority over the movement of the ball towards the cursor.