Game Development Community

Item floating

by ERICK MIRANDA M · in Torque Game Engine · 11/24/2010 (6:25 pm) · 10 replies

Hello thanks for your time. My question:

How do I get an item is floating? When I create an item in the game. This begins to rise. The parameters used are:

mass = 1;
density = 1;
friction = 1;
maxvelocity = -1;
gravityMod = 0;

And the item begins to rise and I want to stand still.

Thanks for your help!!!

#1
11/24/2010 (7:08 pm)
If you want just your item stays in air without particular animation and without coding, you can simply add an offset between the origine of item and the bottom of the item in Blender by example.

Item
O
F
F
S
E
T
Origine
-------
GROUND
#2
11/24/2010 (11:06 pm)
Really thanks for your help Jean... I dont know how is it. This is my case. In my game, I have a menu with buttons, any button add some item, one of them could be in the air (floating) but when add the item, this item is in the air, but this begin to raise to infinite (I dont want this). My model (dts) is in 3ds max. But I guess this isn't the problem.

New again, thanks for your help everybody.
#3
11/25/2010 (1:16 am)
Which version of tge are you using?
Looking at the health.cs, you need this datablock:
datablock ItemData(HealthKit)
{
   // Mission editor category, this datablock will show up in the
   // specified category under the "shapes" root category.
   category = "Health";

   // Basic Item properties
   shapeFile = "~/data/shapes/items/healthKit.dts";
   mass = 1;
   friction = 1;
   elasticity = 0.3;
   emap = true;

   // Dynamic properties defined by the scripts
   pickupName = "a health kit";
   repairAmount = 50;
};
Of course, if your object isn't a health kit, you don't need the repair ammount. Hopefully this will help you figure out what your problem is.
#4
11/25/2010 (7:46 am)
Why not just an animation ?
#5
11/25/2010 (7:53 am)
Yes, this is the standard datablock, just put in comment the maxvelocity and
gravityMod parameter;

The health kit stays in air also your item should do the same thing.
#6
11/26/2010 (1:51 am)
Thanks guys for your help. Your answers was very
useful for me. I could solve my problem, was with a %0
#7
11/26/2010 (1:53 am)
Thanks guys for your help. Your answers was very
useful for me. I could solve my problem, was with a
instruction. When I want put my item in the air
just add a instruction

static = true;

in the constructor of my item. Thanks!!!
#8
11/26/2010 (1:54 am)
Thanks guys for your help. Your answers was very
useful for me. I could solve my problem, was with a %0
#9
11/26/2010 (1:57 am)
Thanks guys for your help. Your answers was very
useful for me. I could solve my problem, was with a
instruction. When I want put my item in the air
just add a instruction

static = true;

in the constructor of my item. Thanks!!!
#10
11/26/2010 (1:58 am)
Thanks guys for your help. Your answers was very
useful for me. I could solve my problem, was with a %0