Jump to content

Object gravity


Recommended Posts

Posted

Hello guys,

I've made an object and attached it to an element, I was wondering if I can have something like gravity on detach.

So that the element falls and lies on the ground? should I do this with moveObject?

Regards Viruz

Posted

Well, what i would do is to detach it then get the ground position using getGroundPosition and move it there. I see that moveObject supports easing, definitely use that.

But either way you have a little problem, the object would be half in the ground... so you would need to calculate the height of the object (not sure how to do that..) and divide that by 2 and add it to the end position the object would stop at.

Posted

You can calculate a model's height using the following function:

getElementDistanceFromCentreOfMassToBaseOfModel 

  • MTA Team
Posted

Physics cannot be applied to objects at the moment :( You could try and make a physics object (certain objects have physics inbuilt), make it invisible and attach your object to the physobject. moveObject is useless if you want to interact with it easily.

Posted

You should use a flower pot (vehicle) id: (594)

And then just detach the flower pot with your object attached on it.

So you need to attach the vehicle on the moving object and the object which you want to fall on the vehicle, pretty simple.

Posted
Physics cannot be applied to objects at the moment :( You could try and make a physics object (certain objects have physics inbuilt), make it invisible and attach your object to the physobject. moveObject is useless if you want to interact with it easily.

There is a slight problem there, as far as i know the object won't start moving/falling till you touch it. And if he is attaching it just for this purpose i myself would disable collisions for it.. so that wouldn't work.

Using vehicle as denny199 said would work, small vehicle like flower pot is gonna do.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...