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. 

Looking for functions like ' OnStartedMoving '

Hello community,

I'm currently making some skill system. for now i want to make channeling skills that which activates while im standing on ground and not moving.

i want it to be canceled when i start pressing W,A,S,D , Space bar ( for jumping )

To do that, i need a callback function that tells player pressed that. so pawn is moving.

I made it to be canceled when player jump. by overriding ACharacter::OnJumped_Implementation()

But i can't seem to find a function for movement.

is there a function that i can override for this situation?

  • i may send RPC to server when client press WASD key, but it will use lot of network resources so i don't prefer that (since they will press them a LOT to move around, and it will be nice if i don't use additional RPC calls for canceling since character movement is actually made on server so server knows player wants to move their character. )

  • i may check players speed on tick event so when its higher than zero, cancel the channeling. but when someone push me using LaunchCharacter function or something, i still want the channeling skill not to be canceled, so i can't use that way

  • For now, considering making Replicated bool variable called ' IsChanneling ' and send RPC to server to stop it when player press WASD, while the IsChanneling is true, it seems best options i can use it now, but i really want it to be processed on serverside without extra network

Thanks a lot for viewing this.

Product Version: UE 4.17
Tags:
more ▼

asked Aug 23 '17 at 12:17 AM in C++ Programming

avatar image

RocketMania
1 1 3

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

1 answer: sort voted first

Personally I like to use bools to determine if a player is doing a certain action then based on the bools do an if statement. For example when a player presses a movement key a bool named ismoving would be set to true. When the movement key is released the bool is set to false. Then have an if statement check to see if these statements are false. If false then the player can perform whatever actions that required to be standing still.

To cancel it I would think while the channeling skill is being performed have a bool ischanneling set to true. Then an if statement that says if ischanneling is true and ismovement is true then cancel channeling move and set ischanneling to false.

More conditions for canceling / performing chanelling moves would just need more bools.

I made something kind of similar for a slide mechanic in blueprints. Only when the character is sprinting can the slide be performed. If you think it may help I can share some screenshots.

more ▼

answered Aug 23 '17 at 12:55 AM

avatar image

Zachkm
6 1 3

avatar image RocketMania Aug 23 '17 at 11:55 AM

You're right. for now the simplest way is making the bool variable and check if they're true to perform the action what i wanted.

Anyway i successfully made the channeling - cancel thing and currently getting no bugs for now. seems fine.

Thanks for the answer!

But still if anyone knows the override-able function when called when player started moving from stopping-state, please let us know so we can improve the system! thanks!

(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