Probabilistic spawning and click interactions

So today I wanted to tackle the objects that the player can pick up.

I tried to make some changes to the way the pick up happens, in the past it is based on collision. if the player is close to the object they will just pick it up. this time i wanted to switch to be more deliberate when i found a tutorial that says I can do a “on click” event on static meshes. I tried doing that both on the item parent BP as well as the general target box BP (that i am currently using to test the destroy functionality).

No luck.

Weirdly that although my “on click” event isn’t firing (and i’ve checked both in the project setting and game controller setting that click is enabled), the “on cursor over” event works on a click. not quite sure why but i’ve left a comment in the blueprint graph to remind myself about that oddity.

weightedSpawnCollectable.gif

I then was referencing an old video I’ve watched before about how to generate recipes and spawn rate using a more formulaic approach. Not quite sure what is saying about frequency and rarity actually works for me. So instead of followed this youtube tutorial’s loot weighted table approach: using a mapped variable and some math to calculate. I think overall it did what I needed it to do.

Next Steps:

  • Being able to position the spawned object in relation to the WFC tiles

  • Able to recover health with eating a tomato