# Getting sprint to work in multiplayer

**URL:** <https://forums.unrealengine.com/t/getting-sprint-to-work-in-multiplayer/293915>\
**Category:** Multiplayer & Networking\
**Tags:** Networking, unreal-engine, Multiplayer, CPP, question\
**Created:** [September 17, 2014, 7:49am UTC](https://forums.unrealengine.com/t/getting-sprint-to-work-in-multiplayer/293915 "2014-09-17T07:49:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris528](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chris528](https://forums.unrealengine.com/u/Chris528)\
**Post date:** [September 17, 2014, 7:49am UTC](https://forums.unrealengine.com/t/getting-sprint-to-work-in-multiplayer/293915/1 "2014-09-17T07:49:09Z")

</div>

Hey everyone, I’ve been trying forever to get sprint to work for multiplayer games. It seems like it has to do with replication but I’m really not sure. I have a function in my character class called IsSprinting() that gets called from a custom character movement component. It just returns the value of a bool that i have in the character class.  
Here’s my code

[http://pastebin.com/raw.php?i=CK46cqfb](http://pastebin.com/raw.php?i=CK46cqfb)

Basically when i run it in sp, and am sprinting it displays, “Server, sprinting”  
But when i run it in mp as a client and am hitting sprint, it says  
“Client, sprinting”  
“Server, not sprinting”

I really have no clue on how to fix this, and feel like I’ve tried everything.  
Any help would be extremely appreciated.

UPDATE(working code):

[http://pastebin.com/raw.php?i=zbdLezSB](http://pastebin.com/raw.php?i=zbdLezSB)

[http://pastebin.com/raw.php?i=9SnRU1Vv](http://pastebin.com/raw.php?i=9SnRU1Vv)

---

<div class="post-metadata">

**Author:** ![Duncan\_Dam](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Duncan\_Dam](https://forums.unrealengine.com/u/Duncan_Dam)\
**Post date:** [September 17, 2014, 10:08am UTC](https://forums.unrealengine.com/t/getting-sprint-to-work-in-multiplayer/293915/2 "2014-09-17T10:08:03Z")

</div>

where you set Sprinting value ? oh and it must be set on server to be replicated for everyone.

---

<div class="post-metadata">

**Author:** ![Chris528](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chris528](https://forums.unrealengine.com/u/Chris528)\
**Post date:** [September 17, 2014, 11:15am UTC](https://forums.unrealengine.com/t/getting-sprint-to-work-in-multiplayer/293915/3 "2014-09-17T11:15:54Z")

</div>

InputComponent-\>BindAction(“Sprint”, IE\_Pressed, this, &ADiceyCharacter::OnSprintPressed);  
InputComponent-\>BindAction(“Sprint”, IE\_Released, this, &ADiceyCharacter::OnSprintReleased);

```
void OnSprintPressed(){ Sprinting = true; }
void OnSprintReleased(){ Sprinting = false; }

```

And how do i set it on the server?

---

<div class="post-metadata">

**Author:** ![Duncan\_Dam](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Duncan\_Dam](https://forums.unrealengine.com/u/Duncan_Dam)\
**Post date:** [September 17, 2014, 11:46am UTC](https://forums.unrealengine.com/t/getting-sprint-to-work-in-multiplayer/293915/4 "2014-09-17T11:46:48Z")

</div>

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

Check out the Client to Server command

---

<div class="post-metadata">

**Author:** ![Chris528](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chris528](https://forums.unrealengine.com/u/Chris528)\
**Post date:** [September 17, 2014, 1:21pm UTC](https://forums.unrealengine.com/t/getting-sprint-to-work-in-multiplayer/293915/5 "2014-09-17T13:21:11Z")

</div>

Perfect, thank you very much, that worked
