Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bge
- def main():
- cont = bge.logic.getCurrentController()
- own = cont.owner
- scene = bge.logic.getCurrentScene()
- mouse = cont.sensors ["leftMouse"]
- getBall = cont.sensors ["getBall"]
- #throwBall = cont.actuators ["Throw"]
- if getBall.positive:
- own ["balls"] = 1
- #Gooi bal
- if (mouse.positive and own ["balls"] == 1):
- #cont.activate("Throw")
- Throw_point = scene.objects["Throw_point"]
- Throw_point_rotation = Throw_point.worldOrientation.to_euler()
- #Throw_point_rotation[2] = 0
- scene.addObject("Dodgeball", Throw_point)
- print(Throw_point_rotation)
- dodgeball = scene.objects["Dodgeball"]
- dodgeball.applyRotation(Throw_point_rotation, False)
- print(dodgeball.worldOrientation.to_euler())
- own ["balls"] = 0
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement