Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
FireRaven
19
Years of Service
User Offline
Joined: 24th Nov 2005
Location: Norway
Posted: 14th Oct 2006 12:12
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:

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,
FireRaven

Codger
22
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 14th Oct 2006 20:46
This works if you wish to fire in the direction the camera is facing


Subsitute the camera moved position for a target if you wish to aim in any direction other than the direction the camera is facing

all the best
codger

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem
FireRaven
19
Years of Service
User Offline
Joined: 24th Nov 2005
Location: Norway
Posted: 14th Oct 2006 21:39
This did not move the rigid body in any way.
It just fell down by the gravity as before.

I copied the excact script from above and added the temp = make vector3(1) at the start of the code. Why does it not work?

Codger
22
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 14th Oct 2006 22:03 Edited at: 14th Oct 2006 22:07
I suspect if has something to do with the size / mass of your object. a bullet should be for example 9mm in dia or .009 meters and should have only .01 kg of mass. applying a force of 500 should propel a bullet.

your object is a 50 meter cube that takes a lot of force to move even if it was made of foam

Try increasing the forces and or reducing the mass of the object.

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem
FireRaven
19
Years of Service
User Offline
Joined: 24th Nov 2005
Location: Norway
Posted: 14th Oct 2006 22:33
I just added another force with mode 5 (accelration) and it worked fine. Thanks!

Login to post a reply

Server time is: 2024-11-24 15:00:58
Your offset time is: 2024-11-24 15:00:58