I've been trying to make an object move towards a point using forces, but I can't seem to get it right. As I want it to move towards the point where the camera was facing before the function was executed.
Here's my functioin:
if object exist(67) then delete object 67 : phy delete rigid body 67
make object box 67,50,50,50
position object 67,camera position x(),camera position y(),camera position z()
rotate object 67,camera angle x(),camera angle y(),0
REM *** Create the Rigid Body for Physics Simulation ***
phy make rigid body dynamic box 67
phy set rigid body position 67,object position x(67),object position y(67),object position z(67)
phy set rigid body rotation 67,camera angle x(),camera angle y(),0
But before the endfunction I want the force to be added. I've tried phy set rigid body linear velocity
and phy add rigid body force
, but first of all:
1. The box object positions at a very offset position, not visible even if not moving the camera at all.
2. The camera automaticly rotates into another position than before without executing any rotation commands.
Any help on this?
Thanks in advance,