Hey guys i’ve tried several different ways to go about creating a very simplistic scoring system for my game but I have been unable to get anything to work. I have followed several tutorials but each time they are slightly different than what I have or need so I have been unable to get it to work.
The game is a little stupid but its for a class and my group members came up with the idea so bare with me lol.
The FPS is supposed to shoot a booty and in this case I have named the booty Targetbooty and it is a actor blueprint. Everytime the FPS shoots the booty he should be able to get 1 point which will display on his hub. I have created the hub and tried to link it to the booty but each time the bullet goes right through the target. I think it has something to do with the "Cast to FirstPersonCharacter is not compatible with Self Reference error that I keep getting when I try to plug into the target of Totalbootys
Here are pictures of my other blueprints and how I have them set up.
My score hub^^
This is urgent only because this is a graded project and it is due in 72 hours and I just need to add the scoring system to be done.
Alright Mr Booty. Do you really need that totalbooty function inside booty BP? Put that booty function inside character and call it a day. Cast to character, dragout from character output and add the booties inside character. (just put it inside event graph, forget the function). Either that or create yourself a BPI for BootyCharacter or Event Dispatchers.
- Follow this Video and you’ll be golden for more booties.
Good luck! If this answered your question, please upvote and mark as answered.
Well I went ahead and deleted the function from the Targetbooty and I had the function inside the FirstPersonCharacter. Are you saying in Targetbooty after the “OnComponentBeginOverlap(Cube)” to cast the FirstPersonCharacter and Addbooty cuz I did that and the projectile is still going through the booty instead of hitting it.
this naming convention is hilarious, and kinda inspiring. it makes me wonder, is Projectile really the best name for bullets? i was thinking maybe a shorter word would be better, like Dart or Shot or Ball or Ammo or Shell.
lol booty isnt the name of the projectile, booty is the name of the target that im hitting
Cast to FPC, on output, you +1 totalbooty, you are not using a function anymore. You are just doing the math manually from inside total booty, once BootyTarget gets hit, it casts to FPC, adds one (sets) to the value of TotalBooty (that’s inside FPC) and that variable inside FPC is what you are using to keep track of the total booty. Keep it simple, don’t make a function out of it, just comment it out and put it somewhere in event graph. I do still recommend watching that video, it would have helped you out with all this and thensome.
Actually, on looking at that mess of yours… there’s too much booty and it got my booty confused. Okay, so listen. All you need to do is GET TOTAL BOOTY after casting from TargetBooty, +1, SET TOTAL BOOTY, done deal. You really have way too many variables/functions that are all doing the same thing…you need to refactor this whole thing…but yeah…just do what I said. delete anything that adds booty. Put the booty code inside FPC, cast to FPC, get, +1, set total booty, call it a day.
hey I feel like your on to something. I went ahead and deleted excess functions and variables and have now added it to the FPC but i get this error because I do not have an object. When I try to call Targetbooty as the object there it is not a simple get it has a back end as well…
By the way thanks for responding so quickly. Still new to this.
Why are you casting to Targetbooty to increase it? Make all that code work INSIDE player character. All you need to do is from Targetbooty, cast to FPC, then have it add +1 to Totalbooty variable. You are going in circles.
ok you were right so I tried to put everything in the FPC and I went ahead and followed that video you posted earlier but now im stuck again lol sorry im making it so difficult.
Towards the end at around the 2 hour mark he sends his text box to a get percent but since im not using a percent where wouldnt I use an integer instead so when i look for SetInteger there is nothing so how do I tie the the text and the updatescorehub together?
Im also wondering if im binding the totalbooty and Targetbooty correctly because even if i get the text box to work it wont do any good if it isnt calling the targetbooty correclty
Here are my blueprints so far
What the… LOL. Again…you ONLY need ONE function/event adding to booty… Is that first call in FPC, always set to 0 (default) I am assuming? On begin play. If it is, okay, I wouldn’t have done it like that, but let’s just leave it, as long as it’s working since it only happens in the beginning and only once. That addbooty call looks fine, it’s adding one and sending it along with the call to update the UMG. But before I get to the UMG, what the heck is that set totalbooty doing? I’ve actually never used Other Body Index, but that doesn’t sound like it should be setting anything of TotalBooty. If anything, that’s almost like a player index, but anyway, take that out. not needed. What you need to do, is when Targetbooty is hit, you call the AddBooty function inside FPC. You really went about this the wrong way. But anyways, finally that UMG…we need that to update. The text block should be the one that’s bounded, and so you should have an output, but that’s inside event graph…so that’s completely wrong. you need to bind the text, so you can manipulate it.
Anyway, once you figure that UMG stuff out you are good to go. Upvote and mark this as resolved when you get done please:)
ok you were right ive got it showing up as 0 now. So now I just have to figure out how to add 1 each time the object is hit
dont leave it late to do assignments… especially when your extremely new to unreal