Counter of overlap actor increase by 2 and not by 1

Hi, I’m trying to create a blueprint which increase the star counter everytime the player overlap it. It seems perfect to me but in the game this counter goes by two or three sometimes and idk why.

There’s some italian words like stella which means Star.




Hey @Techttv!

I don’t know if you’re aware, but your video is borked :stuck_out_tongue: it only shows the primary editor screen, and I can see by your mouse movements you were trying to show code. Try using screen snips for your code so we can take a look! :slight_smile:

1 Like

Does these content help you helping me? :sweat_smile:

It did, thank you!

You will want to add a “Set Collision Enabled” node after “++”, and set the “Pawn” collision to False. That way you can’t trigger the collision more than once. You can also destroy the actor if you wish :slight_smile:

1 Like

u could use a “do once” and after leaving a zone or whatever reset the “do once”.

Thanks but I think I found out the problem… The stars aren’t spawning but moving. When they moves the player overlap them and increase the counter. I activated the teleport in the node to move them but I don’t know how to make them teleport at least 30 from the player… Any suggestion?


Tried but it doesn’t work. I put the reset when the actor end overlap

With debugging I found out that when it’s overlapped it moves the actor two times sometimes dunno why.

hi,
you could make a bool like isPicked? or something and set it right after the branch to true and use a other == player actor AND NOT isPicked? for the branch… then you could reset the bool later too if you want too… but like Mind-Brain said you cant see nothing in the video or the outliner.

i hope it helps you :slight_smile:

cheers

I’ll try but the problem is which condition reset it? Would you suggest me to switch from moving actor when overlapped to spawning everytime a new actor?

hmm you could make a star / stella pool and set em right after picking to visible false, no collision and reuse it again, make a function like boot and there you could reset the hole thing and make a new entity. hehe i am thinking :thinking: maybe i come up with something better, back soon :slight_smile:

hi,
sry for late reply, had a little work to do, but…
i made some tests and a little example, which works quite good :smiley:

ThirdPersonMap_AdobeExpress
i made a little pooler for the stars and if they are picked up they send all over interface.

the crude spawn code in game state



here is the pool and stars get generated

this is the player action (all use the same interface, player, star, widget


in boot the star gets new settings after coming from pool


and last the widget

hope it helps :slight_smile:

cheers :vulcan_salute:

hold a sec. There isn’t an easier way to make them spawn and when overlapped disappear? I was thinking about making it with an array but idk how

yes sure, here it spawn only as much as needed… but sure you can spawn it every time and delete it, in this case the stars get composed ^^

you can spawn an delete them with no pooling at all

however I can’t understand Pick Ups interface in your image. It’s a new blueprint? How can i add it? I can’t add it in My Blueprint section in WID_PickUp. Sorry but I never used them

ohh you mean the PickUp Event ?
I am so sorry i see i missed an image of the interface, i will make you one.
That is the Interface with only the function called PickUp. then player actor, star and the widget have the same interface.

ohh okok I thought I was missing something

just an empty function to trigger, so you do not need a specific cast

i am back in a few minutes, making dinner :vulcan_salute:

Hi, I copied everything in the pic but it’s not working. Thanks for help but I prefer to find a way I really understand. :slightly_smiling_face:

Ok but if I do it that way how I can make the actor respawn? I need to spawn or move the star to a new location.