By collision you mean that other objects stop on it ?
Yes, sure.
But I want to use the Collision Sensor, to sense the contact with the player’s cannon ball.
AFAIK, the Collision sensor does not work with Static objects.
If both objects are Static actors it does not work for me.
I have a tank that shoots missiles --> Static actors.
But I am forced to make the enemy tanks Dynamic, or Rigid Bodies, or whatever,
because if the enemy tanks are also Static actors, then nothing happens when they come
in contact wit the missile. Just changing them back to Dynamic, makes them work again
(no other settings changed).
If you know the answer to this problem, please advise, because it is quite important for my project.
leave the hangar static give it a collision sensor looking for property “bullet” or whatever. Doesn’t need to be an actor.
On the hanger - Sensor Collision “bullet” (without quotes)-----and-----add object actuator(s) and an end object actuator (so hanger ends, and debris is spawned)
Make your missle dynamic, give it a property called “bullet” it don’t need to be an actor. and shoot it from an empty.
On the Empty - sensor (whatever)---------and----------add object missle lin velocity 50 or whatever
Make your broken hanger, debris pile, rocks, whatever and put them on an inactive layer. make them dynamic, add a motion actuator to fling in the Z axis, with some rotation. (see below)
On the debris - Delay 0---------and----------Motion lin v 5, ang r 5 or whatever.
Delay 20--------and-------state 2 this will send them flying, then fall to earth.
Now add these to the hangers logic so they all appear when the missle collides with the hangar.
For Static collision detection one of the objects MUST be a sensor object. Whether this means parenting a sensor on top of an existing static object is up to you. Selecting actor won’t affect the result for static ->static.
Hi Tim. No, not true, the missile is dynamic, the hangar is static. it works in my tests.
Test the way I described it. It works.
I could post a blend, if need be.
Selecting actor won’t affect the result for static ->static.
Right . . . I think.
P.S. And the hanger dosen’t need to have the collision bounds ckecked in the physics panel.
For Static collision detection one of the objects MUST be a sensor object.
This is true. 2 static objects won’t collide with each other.
dynamic will work, should work and does work.
Just don’t use static objects for things that move. (exception for moving platforms, etc)
so…
tank = dynamic
place an empty in front of the tanks barrel, parent the empty to the barrel/tank.
let the empty spawn a missle, this missle will be dynamic, collision bounds sphere/box (depending on the missle looks).
tank done, now the hangar.
build your hangar, dont change any of the physics settings.
at the spot you want to spit out tanks, place an empty, let that empty spawn the tank.
now you got a building spitting out tanks, tanks can shoot missles, missles fly to wall and collide.
also be sure to check collision box/sphere for the bullet, leave the walls as is (meaning spawn a cube make a wall out of it and dont change a thing at physics). for the bullet, make it dynamic, collision bounds sphere/box. let an empty spawn the bullet with some velocity(speed), it will fall down over time(like a real bullet) at more speed and increase spawn hight to get a goot looking bullet flying to its target.
Note.
Don’t give the bullet a to high speed, else it will skipp the collision detection and fly straight trough.
best way is to shoot a ray in front of the flying missle, but i guess thats a bit to advanced for you at this time.
The instructions are in the scripts panel. As you can see, there are no sensors, and it works. ( by sensor, I mean instead of static, dynamic, etc.)
You don’t have to use dynamics or ridgid body on the tanks, you can use static, if you want. Just beware that the tanks will go threw walls, and not follow the terrain, or fall. But there are cases where this might come in handy, a ghost for example, fully rigged with bones, but you want him to float and go threw walls, or rats running in and out of a scrap heap. Or if too many npcs are dragging the frame rate down. perfectly fine to use static. IMHO
Agreed, Edit object > replace Mesh, is something a beginner can do.
You don’t have to use dynamics or ridgid body on the tanks, you can use static, if you want. Just beware that the tanks will go threw walls, and not follow the terrain, or fall
you actually counter yourself, i agree on a flat surface it my come in handy to use static, but to be honest i dont see a reason why you dont put it on dynamic.
things that move = dynamic (anything but static, except for moving platforms)
things that are not being used, or not moving, etc. should be static.
But there are cases where this might come in handy, a ghost for example, fully rigged with bones, but you want him to float and go threw walls, or rats running in and out of a scrap heap. Or if too many npcs are dragging the frame rate down. perfectly fine to use static. IMHO
No it is not perfectly fine, they made the ghost option for it, use that one, dont use static. if you want to go trough walls, ghost is an option, or set it to no collision, either way both are better then static.
Hmmm, you could be right, But I have used static in a few of my games, and it ran perfectly fine. A gamer who wasn’t a dev. wouldn’t know the differance. In one game, too many dynamic npc’s dropped the fps so it couldn’t be played. So i changed them to static, and it worked fine. But you are probably right, there could be a better way.
If it were Ghost, wouldn’t it drop through the floor? Still, a track to closest script, or track to actuator could solve that. (see I counter myself) LOL
As for counter myself . . . I do it all the time LOL. Hmm on the other hand . . . LOL
Thank you guys, OP here, really valuable information,
it seems I have messed things up a little bit, because my projectiles are static (it was easier to program their ballistic trajectory this way)
Since tanks were dynamic, it was not a problem…
…until now, that I want a destroyable hangar and also need the projectiles to not go through walls (which are also static) ---->Unsolvable, unless…
…projectiles are made Dynamic. So this is what I will do next.
A little issue is that =
I would like gravity to not interfere with the projectile.
Is there some easy way to turn off gravity, but keep collision, on a Dynamic object ? Unchecking Physics seems to disable collision as well.
give the missle an upforce, 9.8 is default gravity, so with bricks i would just do, always - motion - apply z force.
or dive into python and learn how to shoot rays in front of the missle, then you can leave it static.