Hey i have a zombie that is going to spawn when a delay actuator activates.
The zombie have a propherty of 100, and when the gun raycast and mouse click the health will add a “-1” to it, and when it reaches 0 the zombie will “end object”
The zombie works perfect, but when i make a “delay-and-add object” the propherty settings gets mixed upp so the propherty doest substract -1 when i hit him.
The “add object” logic is copying the object i have selected from the other layer.
Is there a way to spawn an object and keep the setting? or prevent blender from making a new propherty to every copy?
umm im not sure how to do that, also teh raycast is only making dammage if it hits material “zombie” and the zombie have that material, but when it gets dublicated in the game, will not the material turn in to a “zombie.001”?
The zombie is in the other layer, the big box around teh zombie is gonna be where the raycast will collide with, and the propherty numbers above the zombie is just for me to se if the zombie gets hurt or not ( will be removed later) but when he gets hit the number should start lower down
I do not understand the file. Cube.008 does not add an object as there is no object set. Which one is it supposed to be?
I can see you have quite much inter-object connections. As you see this makes it look very complicated. It also means each connection is a dependency from one object to another. This itself is not a big deal as long as the objects belong to each other e.g. the status text and the object.
But there is a dependency between the gun object and the zombie box. This can’t be correct as you create a connection to an inactive object (the zombie box is in layer 2).
I guess you want to perform the hit operation. This is a dynamic operation as you do not know beforehand what will be hit in-game. Here you need a Python controller that reads the sensor and deals with the hit object. You can’t use the primitive logic bricks only.
I think he just needs to get the specific zombie that gets hit as a simple material check will subtract health from ALL zombies added. You will need to use python. Ray sensors have a hitObject.
ray = own.sensors["Ray"]
if ray.positive:
ray.hitObject["Health"] -= 1
Something like that. If you aren’t familiar with Python scripting yet you should look up a couple tutorials on it first.