I have a Collision box around my cubes in game and if you overlap it, it drops the cube you have picked up. I sometimes have multiple cubes and I don’t want you Bumping into cube A to drop cube B that your holding, i want them all separated by tags/names. I can tag the cubes in the level but I cant seem to figure out how to check what cube I have held and get its tag from in the level.
Okay so I did get the first part of it working and now when I have a cube picked up and I bump into another it wont drop the one in your hands. But now iv got a issues where this collision box on the cubes wont let you pick it up if you are overlapping with it (they could fly around on it pretty much and I don’t want that so I set a event begin overlap boolean check to deny pickup) So I went back to tags and tried to work out a solution this is what I have. Once you Right click it traces below you 200units to check if a box is below you. If one is it will break the hit result and give you the boxes tag name in the level (this function works and I can get each box name properly) Then you jump over to the grabbing construction graph and I check the box tag variable I set prior and use the actor has tag node to give me a boolean and hook that into a branch to allow you to grab as long as its not the box that’s below you.
I feel as though I’m just off with the blueprints and maybe I’m missing something small because I can still stand on top of a cube and pickup the one below me.
If you don’t want to pickup stuff below you, don’t start the trace from the bottom of the capsule
Oh, ignore that comment…
Ah, un-ignore that. You are doing the trace from the bottom of the capsule.
Why not do a capsule trace in front of yourself?
I wanted to be able to stand on a cube and pick another cube up. The trace from the capsule that traces down was so that it would pull that tag of the cube below me and then tell the grab function that i cant grab the one below me but i can grab any other cube.
I guess in short i wanted to trace down and get that cubes number, then tell the BP that i can not pickup the cube below me but i can pickup any other cube.
You can write a function ‘standing on cube’. In your pickup BP, just make sure to check NOT( standing on cube ) before attaching it.
I takes the tag as a parameter, and returns a bool.
I guess I’m just not understanding. I had a boolean if i was overlapping the cube preventing my from picking it up. But I’m trying to avoid using that because i want to be able to stand on a cube and pick a different cube up. Was the blueprint i did before bad or wrong for any reason? i feel like it should work but it just doesn’t. If you could explain more with pictures in blueprint that would be helpful.
It looks ok, apart from:
This will set nothing. You don’t need a loop, it’s only one cube. Just take element 0
Also, it probably does no harm, but you don’t need:
because you are in the blueprint already.
So my Print string is reading off what cube is under me correctly but your saying its not setting the tag though? also I’m really new to tags. how do i go from tags array to setting the tag name? i used a loop because that’s how i figured out how to link them up.
I don’t get how you know the tag you want is the last one???
The tags are just an array. You can set them: