i dont get ekstra ammo when i pick it up

hey so i made my game basic still in learning budt when i walk into my cube im supposed to add 1 clip budt instead it disapere and dont give me enything this is the video i followed i did exacly what he did even re check

This should be in the Support And Discussion section.

you are giving to little to go on, hard to give an answer

i did all the steps in the video so i dont know why it wont add btw are you from denmark

you have to show what you did, a blend would help.

here is something i did from the top of my head, it might help you.

http://15b.dk/blendfiles/ammo-pickup.blend

here is the blend file

Attachments

untitled.blend (714 KB)

are you sure thats the right blend ,its just a model of a sword.

fuck sry here is the right file i uselley dont name em123123123123123.blend (864 KB) here is the real one

the collision box of the player is not hitting the clip.

turn on “show Physics Visualization” to see

remove the collision sensor from the camera and put it on the player cube.

What is what you want?

This is what your implementation is doing:

  • When the object “Clip_Pickup” collides with an object that has an property “Player” the object “Clip_Pickup” disappears
  • When the object “Camera” collides with an object that has an property “Clip” the property “Clips” at object “Plane.001” increases by 1

I do not know why these reuqest are that much isolated. They have nearly no relationship to each other. I would request following:

  • When a clip object is picked up:
    –> the clip ammocounter (property “Clip” at “Plane.001”) increases by 1
    –> the clip object disappears

There is no need to measure two different events unless you have clips that should disappear and others should not. If that is the case I would implement two different kind of clips that are treaded differently.

There are several ways to implement that:

A) let the clip do the work:

  • the clip detects the picking up (collision with the player)
  • it ends itself as you already do.
  • it tells the clip counter to increase the clip count e.g. by sending a message “player picked up clip”

the clip counter:

  • on receiped of message “player picked up clip” - >increase clip counter

Assumption: there is only one pick up at the time (otherwise you need to count the messages)

B) let the “clip sensor” do the work
The clip sensor is the object that detects clips e.g. “Cube”.

  • the clip sensor the picking up (collision with the player)
  • it ends itself the clip (needs to be done via Python).
  • it tells the clip counter to increase the clip count (e.g. by message as decribed above or by Python as you use python already)

Assumptions: all clips are treated the same.

C) mesaure the event twice

This is what you do. But you shoud ensure the events have a corelation. I do not see the relation between the collision of camera with a clip object and the collision of a clip object and a player object.

-> why does the camera collide with anything? It should not, so it can’t measure something
-> due to the different “object types” (identified by properties) there is no guaranty you measure at the same time.

can you tell me where physics viualzation is

main menu -> game

can you be more detailed?

2 places you can turn it on


ooh thx budt he still dont get an exstra clip

As said earlier, you kill he clip, but you never add it to your counter due to measuring different events. I really doubt your camera will ever collide with anything (it has no mesh).

budt why does the clip not add and the cube disapere

blender is case sensitive you clip has a property “Clip” but you collision sensor is looking for “clip”

clip is not equal to Clip

here i fixed your blend so it works.
http://15b.dk/blendfiles/fixed.blend

Because, the clip looks for collisions with object that have property “player” -> ends itself, but it does not do anything more (not even notify someone that this happened).

You let the Camera sense for a collision with objects that have property “Clip” -> to increase the counter.

Why do you think these two collisions happen at the same time? There is no relation between this two events.

Let me go deeper:

When the player collides with Clip -> The first event triggers and let Clip end.

After that the camera has no chance to collide with a “Clip” object as the last one is gone.

So lets switch the order. The camera collides with Clip. If that ever measures that collision (I do not think this will ever happen with your setup) it will increase the counter (but not remove the Clip). This means any subsequent collision with a Clip will increase the counter too.

This is the consequence to measure to different events, while you really want to measure a single event (either collision with “Clip” or with “player”). Indeed some rare setup can make both events happen at the same time. But not in your situation.

okey i understand now im new to blender so im still learning thx for the help