I searched the forums for this, but couldnt really find anything. I need to make it capable for my game to, when you click the mouse, add an animated sphere where the mouse clicked, and the cube to go to the animated sphere. when the cube gets to the sphere, he stops, and the cube goes away. Oh also I need the sphere to always be on the ground so that the cube does not leave the ground. Im not sure whether you would need python for this or not, but I attached the .blend and all it needs is what I explained above.
In the PlaceSphere script rewrite the process part like this:
scene = GL.getCurrentScene() # this can be at the top of the script, under "import GameLogic as GL"
if click.positive and mouse.positive:
if "OBSphere" in scene.objects:
hit_pos = mouse.hitPosition
new_sphere = add.objectLastCreated
new_sphere.worldPosition = hit_pos
new_sphere.worldOrientation = [[1,0,0],[0,1,0],[0,0,1]] # Set orientation to normal
Lol yah thats what I meant… Thanks!
Heh, well, I’m glad I guessed right (ninja skills at work ), but please, take the time to re-read your own post.
It will make things much easier for non-ninja folk.
This is what I’m wondering: “Does this guy want me to write his game for him?”.
Don’t be lazy. Experiment with the setup on your own; reduce the scene to its most basic working components, then add complexity until the system misbehaves.
When it does, you know that the last added part is causing the problem (this problem identification technique can be applied to more than just BGE problems).