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"

Best way to pass values?

So, in my game at the moment, the main character has health and shields, the enemy has health, and the projectiles call Idamageable (which causes the health of said enemies to go down).

While this all works, in my game I want the projectile to say how much damage to deal to the enemy it hits. Im still pretty new, and I thought an interface call would work, but the only thing I can do is say I hit the enemy, but I can't pass a value of how much.

How should I pass a damage value? I don't want to have to cast to the main character and set the value of his health and shields within the projectile blueprint, I'd rather just say how much damage to deal.

alt text

alt text

Product Version: UE 4.9
more ▼

asked Sep 20 '15 at 08:37 PM in Blueprint Scripting

avatar image

7 3 8 10

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

1 answer: sort voted first

In your EnemyCharacter you could create a function (Left of the screen). In this function you can add new inputs by clicking the function box. You then call this function in your FirstPersonProjectile the same way you called IDamageable.

more ▼

answered Sep 21 '15 at 12:15 AM

avatar image

27 4 4 9

avatar image SgtFlexxx Sep 22 '15 at 02:42 PM

Thanks, I'll give it a go and see how it works out.

(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