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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Force stand still on button press

Hello My game is the click to move preset basically. And id like to set up a way for they player to be able to press a button and cause they character to immediately stop moving, then when they let go of the button the character can move again.

alt text

The setup i linked yields decent results but you have to press and release space when you start the game to start moving then when you press space while moving, it stops receiving an input but it continues to the location that was clicked. So im close. The logic is in my head like if "Space" is pressed break input but im not sure how to make it happen. as always any help is appreciated.

Product Version: UE 4.9
Tags:
more ▼

asked Oct 25 '15 at 03:06 AM in Blueprint Scripting

avatar image

CodyScrib
53 9 16 21

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

3 answers: sort voted first

Solved alt text

more ▼

answered Nov 24 '15 at 08:23 PM

avatar image

CodyScrib
53 9 16 21

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

Inside MoveToLocation Function, there is some math to define WHERE TO GO. Just store this vector in a temporary variable when press space, and then, call it the same END node inside MoveToLocation again feeded with this var.

more ▼

answered Oct 25 '15 at 03:49 AM

avatar image

Raziєl
252 32 32 178

avatar image CodyScrib Oct 25 '15 at 03:57 AM

Thanks for answering so fast! But Im going to ask you to hold my hand a bit more through this. So I'm inside of the "Move To Location" function the rest of what you said is very alien to me. I'm not sure how to do the rest of whta you said. hopefully you can walk me through this a bit more alt text

Here is a look at the inside of that function on my screen

avatar image Raziєl Oct 25 '15 at 06:33 PM

The Yellow node, Location -> Goal. Save to a vector var at moment You press apace bar, and then, call StopMove.

avatar image CodyScrib Oct 25 '15 at 06:55 PM

alt text

Like this? im not sure how to make it so it save the variable the moment I press space. I cant seem to call the keyboard event inside of the function. in the Event Graph I can

avatar image Raziєl Oct 25 '15 at 07:32 PM

Yes but you need to connect the In Arrow to realy save this value

avatar image CodyScrib Oct 25 '15 at 08:08 PM

Alright like this? alt text

I assume thats wrong because is doesn't incorporate my keyboard input or the Stop Moving function.

avatar image Raziєl Oct 25 '15 at 08:46 PM

Yes, Now You know where You are going at first, so. Now, make a gate like first ScreenShot, If first press scape, STOP. If second press Scape, call last node with this vector.

avatar image CodyScrib Oct 25 '15 at 09:03 PM

So i have the input, the gate, the Stop Movement function, and the location variable. so when pressed it should stop the movement, and when release it should go back moving normally. So what goes where in this picture.
alt text

I dont see where the Location would plug into.

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

Sorry about gate... Its just a boolean test. Stop starts true. And remember to set to TRUE each click on ground to reset.alt text

capture.png (442.4 kB)
more ▼

answered Oct 25 '15 at 09:21 PM

avatar image

Raziєl
252 32 32 178

avatar image CodyScrib Oct 25 '15 at 09:37 PM

Alright now were cooking! Thank you for being patient with me. A lot of this is very foreign to me. im curious is there anything that i need to do with the "Stop" boolean variable? another little hiccup I had is that when I try to connect a controller variable to the "controller part of the Simple move to location, I can't name it "self" because it says "self is in use by another variable or function!" so this is my current setup (looks just like yours)
alt text

With this set up, in game when I click a space to move and press space he stops moving then i do it again and it skips the stoping and continues and on the third try it stops him again. alternatively if i hold down the click and press space while i drag the mouse around the clicking seems to to override the stop, he stops for just a second and continues towards the cursor. Again that is when i hold down the click. if you are confused i can upload a Gif of this later on

avatar image Raziєl Oct 25 '15 at 09:47 PM

You dont CREATE this var, this var is already created, self is a reference of this blueprint. Just click and drag and with context menu, search for self.

avatar image CodyScrib Oct 26 '15 at 01:35 AM

Alright I fixed that bit here is a gif of what it does in the game viewer with a bit of text to describe it.
alt text

I want the stop moving to even work when i click and drag. So how can i do that? again than you for your patients!

movement.gif (1.5 MB)
(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