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"

A problem making my score rise when moving.

So I have a working score system but to combat cheating in my game I want to make it so that the player only scores points when they're moving. I thought I could do this the same way I let the score system know my player is dead, with a custom event that sets "Is Moving" to true when player input keys are pressed. However unreal had other ideas, maybe I'm just doing something wrong. Not too sure.

I'll post some pics, see of anyone could help me.

alt text alt text

Thanks in advance to anyone who can help!

Product Version: UE 4.7
score1.png (197.4 kB)
score2.png (193.9 kB)
more ▼

asked Nov 23 '15 at 11:56 PM in Blueprint Scripting

avatar image

5 2 5 7

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

1 answer: sort voted first

Hey Adam,

Do you set IsMoving to false anywhere? A lack of input won't do it automatically.

You might have to poll the player's velocity to find out when he stops.

It could be easier to set the value of IsMoving directly in this case

alt text

checkmoving.jpg (41.4 kB)
more ▼

answered Nov 24 '15 at 12:55 AM

avatar image

881 36 14 60

avatar image AdamDoubleU Nov 24 '15 at 01:07 AM

Hi, thanks for the reply. Event tick is in use on my Score blueprint, should I run the event tick through the Set Is Moving, back to the branch? If not what Event do you suggest I use? Also how do I give my Set Is Moving a target? I didn't know that was possible.

Thanks for the help.

avatar image Alderbit Nov 24 '15 at 03:28 PM

Sorry for the delayed response.

I was imagining that you would add the nodes above to your player blueprint graph and set IsMoving on its PlayerScore reference. Do you think that will work?

avatar image AdamDoubleU Nov 24 '15 at 07:24 PM

No worries, and Player_Score Is it's own separate blueprint so I'm not sure how that would work.

avatar image Alderbit Nov 24 '15 at 07:38 PM

The image above (score2.png) looks like the graph belonging to your player blueprint, is that right?

It already contains a PlayerScore variable that it was using to execute the IsMovingEvent. You could instead use it to set the value of IsMoving directly during the Tick event (you might have to add the Event Tick node to the graph).

avatar image AdamDoubleU Nov 24 '15 at 07:46 PM

Ok, I understand now, how do I add a target to the Set and I have an event tick on that blueprint already for something unrelated, what should I do?

avatar image Alderbit Nov 24 '15 at 08:05 PM

Drag a pin from the PlayerScore node, drop it on an empty part of the graph, search for "Set IsMoving" and select it. That should should give you the set node already hooked up to the PlayerScore variable.

If you already have some functionality connected to the tick event, insert a sequence node to keep things separated.

alt text

tick.jpg (93.0 kB)
(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