x

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"

how do i make my character lose energy when they jump?

so ive attempted to make a basic player status system with a health, energy, and mood bar. when my player jumps i want them to lose some energy. i have attached an image of the setup i have for my jump action. i have the health bar set up and it should all be working but i'm not sure where i'm going wrong. if you need to see any other parts of my work please ask. thank you!

alt text

Product Version: UE 4.7
Tags:
jump.jpg (236.5 kB)
more ▼

asked Jun 22 '15 at 11:42 AM in Blueprint Scripting

avatar image

Saphia
11 5 8 8

avatar image Erasio Jun 22 '15 at 12:30 PM

What exactly doesn't work as expected?

avatar image Saphia Jun 22 '15 at 07:54 PM

it dosent take any energy off the bar in the game.

avatar image Erasio Jun 22 '15 at 09:15 PM

How did you do your visuals then?

avatar image Saphia Jun 23 '15 at 10:53 AM

this is the event construction for my player status do i need to add anything to this?

alt text

player status.jpg (267.3 kB)
avatar image Erasio Jun 23 '15 at 11:01 AM

Yes the function you used to bind the energy to your energy bar.

Since it's always 0 it means it's not hooked up properly and doesn't receive the value.

avatar image Saphia Jun 23 '15 at 11:56 AM

so what would you suggest i do, if i change the value to 1 would this fix this.

avatar image Erasio Jun 23 '15 at 12:19 PM

Please show me how you did it because right now I suspect you have no working connection between your player and umg meaning it's impossible right now to display your energy on screen because your screen can't see the variable energy.

avatar image Saphia Jun 23 '15 at 12:23 PM

is this what you need to see? this puts my player status on the screen.

alt text

avatar image Erasio Jun 23 '15 at 12:32 PM

The interesting part is the script of the umg graph itself where you bind a variable.

avatar image Saphia Jun 23 '15 at 12:38 PM

oh sorry im new to UE4, the only other thing i have is this. alt text

binding.png (263.3 kB)
avatar image Erasio Jun 23 '15 at 12:46 PM

Did you check if you actually successfully casted your character and if the variable "my character" is properly filled?

avatar image Saphia Jun 23 '15 at 12:50 PM

how do i do that?

avatar image Erasio Jun 23 '15 at 12:53 PM

There is a pin in the cast node called "cast failed". You can use a "print string" node to check that.

Or use the node "is valid" right before you use it and plug give yourself an error message that way.

avatar image Saphia Jun 23 '15 at 01:06 PM

i dont understand what you mean. do i need to plug in the print string node to the cast failed? if so then what should i do

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

1 answer: sort voted first

your progress bar in umg needs to look something like attached.

your question title isn't correct. You want help making the progress bar deplete, you're stating you already have the variable depleting when you jump right? these are two separate things, it won't deplete the progress bar even if set up correctly unless its depleting properly in your characterBP to start with so make sure when you jump in general that the value is actually depleting as per your characterBP. Also progress bars need to be set in percentages, hence the X 0.01 (100% of 100) (divide 1 by the max energy number to get the percentage right)

I attached an example, but if you don't understand the basics of casting, you need to take a step back and walk through some beginner tutorials. Its not important that you get the copy and paste code you need right NOW. It's important to understand what it does and why, so you can build your own stuff.

progressbar

progressbar.png (118.5 kB)
more ▼

answered Jun 25 '15 at 04:15 AM

avatar image

thankstipscom
654 39 38 72

(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