Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Top-Down Game Click Damage

I'm trying to create an RPG game and the way the default player controls are set up are perfect. How would I be able to keep that and also be able to attack or do damage to an object when clicking on it (and using other keys)? I'm wanting the controls to be very Diablo-like.

Product Version: Not Selected
more ▼

asked Mar 24 '14 at 12:21 AM in Blueprint Scripting

avatar image

11 1 4 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hey MDeathK,

Did you basically want something to the affect of. Keeping the click to location, and if an object such as a Item Drop or Monster. Navigate to that object and do whatever action?


more ▼

answered Apr 08 '14 at 05:56 PM

avatar image

2.1k 75 36 110

avatar image MDeathK Apr 08 '14 at 06:03 PM

Yes, exactly like that.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Okay here is my simple setup. This should help you get in the right direction.

We have to create 2 Actors, a Health Modifying Actor (Health Pot, Floor Mines, etc) and A Monster. The Controller in this example is from the Top Down Blueprint Project.

Health Modifier is simply interacting, it can change health or trigger an event such as Pick Up.

We then declare a tag in the Monster Blueprint to differentiate this Actor from other Players and such. Actions for the monster will be within its own Blueprint.

Player Controller detects Actor is Monster then Attacks.

We bind OnTakeAnyDamage Event to receive Damage from outside sources such as the Monster or the floor mine I created in this example.

Health Modifier from Within Actor Blueprint

alt text

A Monster from Within Actor Blueprint

alt text

more ▼

answered Apr 08 '14 at 07:34 PM

avatar image

2.1k 75 36 110

avatar image ProfessionsQuest Apr 15 '14 at 06:03 PM

Hey there, I'm looking to do something similar to this. When I try out your solution, I can't get anything to return. I keep getting the "None Actor from Break Hit Result" error.

Pretty much whatever I click on, even if it has an actor connected to it (in the details), it won't return and print the string.

avatar image PeterLNewton Apr 16 '14 at 10:25 PM

Did you add the Tag under Actors? It returns none regardless since there is no check on the hit return but if you don't have the actor tag it won't return anything.

avatar image ProfessionsQuest Apr 17 '14 at 02:25 PM

Yeah, I added the tag, but still nothing :(

This is actually happening on pretty much everything I create. I make new blueprints based off of actors and nothing is ever returned.

avatar image PeterLNewton Apr 17 '14 at 08:29 PM

I had problems with posting all the images. You the image "AttackFromMonsterController", this is what needs to be in the Controller of your Pawn. It will detect any mesh with the tag "Monster" in it.

avatar image ProfessionsQuest May 12 '14 at 05:30 PM

Super late reply, but thank you! I got it to work now. :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question