When I set a command for change object position on collision with another object, there is a problem. The position changes ok but the object hurls away.
Press arrow key for ball motion. If ball falls on the blue plane, set a change reset position. I do not restart the scene, only change the object’s position. I use Blender 2.76
script used:
Hi Monster, sorry my English.
my object (player-CubeNove) is a rigid body. Plane is collision for first script
[video]http://petercakovsky.com/docasne/drop.mp4[/video]
I want to do set position as the start game.
hmm… gravity it s strong
YourHint: hard for me Monster I´m veeery noob in python
your code works, ive looked at ur blend, my opinion there is something wrong with ur physics settings.
anyway, your ball will spawn at the right position, but the problem you have is it keep moving in anydirection.
tried a few things, orientation/velocity/angularVelecity none of them got impact on ur ball (slows it down a notch but not totally)
i even removed everything from ur scene and build it again, strange physics, if you move the ball (keep holding down W) when he goes off the ledge it does not fall but float in the direction he was going and dropping slightly at Z direction until you release the key.
i would suggest to use addObject actuator. when ball hits the plane -> end object and spawn a new one. this should solve your problems.
When I set a command for change object position on collision with another object, there is a problem. The position changes ok but the object hurls away
This is due to using rigid body, you change the location but the ball keeps it momentum and spinning actions.
you need to stop all movement/rotation from ur ball when you move the position.
the script works fine…something with the physics is goobered up, but I cant put my finger on it. Turning collision bounds on, on the plane keeps it from falling through
The code works fine. But you forgot to cancel the velocity after teleporting to the given position. That means the ball will still fall down with the speed it had at the time of collision. Due to the steady increase it will fall faster and faster until the physics engine can’t detect the collision anymore.
cube.linearVelocity = [0,0,0]
Anyway, a physics object inside another is usually no good idea (CubeNOVE, EmptyNOVY). If you really want that setup, you better move both objects.