Hi! I am doing some funny game with fighting office workers. I just started to make health bar, but there is a problem. Look at the image:
Chairs are dynamic objects but characters are non collision. Other way whey would fly away. So, they do not stand up. They are always on the chairs. Main character rides on a chair and fight using the keyboard. But the character and the keyboard are moving non collision objects, so, how to make possible to get damage? The enemy is non collision too.
You can try parenting EDIT: invisible END EDIT cubes with collision to the characters, so when these cubes detect proper collisions, they update your character(s)’ respective health properties. So try creating health game properties for your characters, and having python code for your cubes which retrieves their parents’ properties and modifies them. If you’re worried about framerate, simple box collisions usually do next to nothing in terms of slowing down processing time.
Can I just say +1 for concept:
Smashing other people with keyboards while you wheel around in your chair like a boss.
Yes, I tryed that, but cube has a force and when is parented to the bone it works like a catapult. Look at the video.
When they fight being non collision nothing happes. But, when I will place a cube and that cube will work with the bone it will bounce every object. It the character will hit anything with this cube he will bounce and fly away. The force is too big. I changed mass of the cube to 0,001 but it doesn’t work too. It should cunt collisions without physicall effect.
use collision mask, for char character and keyboard, or parent keyboard to player, parent player to chair, use char for movement actions, and set chair collision on compound, player and keyboard can have dynamics also.
edit:
you can also keep everything beside the chair no collision.
so that the chair is the main object, now add all actions to the chair, and just cast a ray in y direction when you hit the key to smash with keyboard, and animate the '‘smashing’, the ray can subtract health. or you can build a little script to actually control the animation frame to subtract health
If that would be my work environment I would think about such a fighting game too ;).
The end boss should be the architect of such a chicken farm.
(The end boss of the next game should be the architect of that car park where you have to climb 5 floors on a spiral ramp with your car to reach the first parking floor.)
Two of my posts which I 've posted 10 hours ago are not published. I’ve placed a video of my game, because it is already working, but of course without fight mode and damade. Oh now, damage is working between “ghost” and chair, because they are dynamic objects. But if noone can publish a video it’s a shame…
@Mirror|rorriM I tryed to parent some invisible cube to the moving hands (bones) but then a cube collide with the character it works like a catapult. The force is too strong even if I reduce the mass of an object.
@cotax The character has an armature (non collision) and is placed to the chair (dynamic) The body, keyboard and Empty (invissible) axis is non collision. That’s how I made it.
@Monster They will not stand up. Main character is riding on a chair and he is fighting also on a chair. I am going to make a couple of modes. First is simple scene, where everythings look normal. When you have appropriet number of points you pass to the next mode. It is a horror mode. The office is then immersed into the fog and the main character keeps a lighting. There are monsters in the dark. Next level can be: terrorists attack (then, he will have M5 rifle), going to “talk” with the evil chairman and so on. But first I need to find a good solution for fighting mode.
+1 for the final boss idea haha In fact, you might make the final boss the boss of the company haha
@Mirror|rorriM I tryed to parent some invisible cube to the moving hands (bones) but then a cube collide with the character it works like a catapult. The force is too strong even if I reduce the mass of an object.
Sorry, I probably should have made this more clear. What I meant by collision is ‘being able to sense touch.’ Try setting your weapons’ physics types to ‘sensor’, and have the weapons check for collisions where objects have a certain property.
When Object A has that property, modify the character’s health via Object A (Object A is a static/dynamic cube representation of a character).
@cotax The character has an armature (non collision) and is placed to the chair (dynamic) The body, keyboard and Empty (invissible) axis is non collision. That’s how I made it.
then select chair and select compound physics, no catapult anymore.
or as i said make everything but the chair no collision and use a ray cast. if ray hit play animation/subtract health.
or make all but chair no collision and parent an cube to the keyboard, put it on sensor type, collision box. put a collision sensor on it, when collided with other bounding box, subtract health.
or place an cube, parent chair, armature,keyboard to it, now you have a good hit able bounding box.
use the cube to move around, use a sensor or a ray etc…
i have no tipps for you…but now ive seen your game the first time (and after brutal laughing)…i must say its one of the funniest games ive ever seen. Go on with it…i want to play it…better i want it to play with friends…a multyplayer-option would be more than cool.
I think the End of the game should be to fight you up to the office of the boss (the Endboss) to be the Boss by yourself;-)
Something is not right. When I make two cubes and make one dynamic and the other static everything works fine. The first one hits the other and in result we can make some additional action. But, whem I parrent any cube to non collision object, or armature, or any other static object is stops working. Cube stops to be a stable, hard body and becomes no collision. Maybe I will give some numbers.
I have a big red oblate cube, which is parented to the chair, and it should work like a wall:
1.Static/Actor/Radius 1 cm/Collision Bounds - Box (margin 1mm)
2.The table is Static/Actor/Convex Hull - 1mm.
When first touches the second it goes through it and stops somewhere inside.
The enemy has a blue cube parented to the hand bone and it is: Dynamic/Actor/Mass 0,01/Radius 1cm/Convex Hull - 1mm.
When the blue one hits the red one they do not bounce, and the sensor doesn’t gets any datas. They also goes one through the other. They should be a stable, hard bodies, but they are not
I have a big red oblate cube, which is parented to the chair, and it should work like a wall:
The object you parent to another object will lose its physics, and will take over the physics of the object you parent it to
so the chair is the main collision detector. if you want the cube as a ‘wall’ then parent the chair to the cube, not the cube to chair.
The enemy has a blue cube parented to the hand bone and it is: Dynamic/Actor/Mass 0,01/Radius 1cm/Convex Hull - 1mm.
this wont work, set it to sensor instead of dynamic, set it to box instead of convex hull, and make it bigger, 0.01 radius is to small to detect collisions (9/10 times).
You can sorta update compound physics type by doing this every frame
pseudo
#Example only
cube.removeParent()
cube.worldPosition = keyboard.worldPosition
cube.worldOrientation= keyboard.worldOrientation
cube.setParent(chair,1)
very impressive for your first game lol it is a great concept, the combined humor and horror element will be a hit to those tubers, I will be looking forward to playing this
If you change your parented object physics type to “Sensor”, it is actually possible to keep the physics for that parented object - have you tried that out yet?
Note that simple sensor type physics will detect both static and dynamic objects, but they will not detect other sensor type physics objects.
Yes I tryed everything as you told me but the effect is different. The chair took all parameters from the red cube and when these two characters collide with the chairs the main character gets damage. When the second character is hiting with the sensor in the red cube it gives nothing.
Through a moment I was very close, but there is still some small detail. I don’t know what it is. I suppose, that the chair is cancelling every action going to the lateral objects. Hitting the chair works fine, but the character not. Maybe I should make a player as a static object, change gravity to -9,8 and make it levitate, then parent a chair and the other objects to it?
I think there’s something wrong with your implementation.
This is how a sensor physics object parented to the bone (or an object itself) of a character physics object can behave like a sensor type physics object (where the sensor physics object is ended from the scene by colliding with an object having a certain property): SensorPhysicsAndCharacter.blend (493 KB)
In this example, the character rotates, then touches its “keyboard” to a plane. Because the plane has the property ‘prop’, the “keyboard” is taken away from the scene.
I suggest you recheck your implementation and experiment with turning off collision bounds for the red and blue cubes.
Also, the chair should not be taking anything from anything unless you want it to. Make sure you are checking certain objects have certain properties when collisions occur.
Yes! I made it. Now I need to make the same with the enemy. I have now damage bar flying over the head of the enemy and this bar has always and is connected with the steering. So, it’s always directed toward the player. I need to work over it.
Great to hear it. I was just able to come up with a blend file only recently (due to circumstances) - sorry for the delay. I’ve private messaged you the file.
Please do keep us updated if necessary! Good luck with your implementation, and thanks!