# \[4.3\] Sending a FQuat over network without setting it to a variable crashes the game

**URL:** <https://forums.unrealengine.com/t/4-3-sending-a-fquat-over-network-without-setting-it-to-a-variable-crashes-the-game/291966>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [August 25, 2014, 10:34am UTC](https://forums.unrealengine.com/t/4-3-sending-a-fquat-over-network-without-setting-it-to-a-variable-crashes-the-game/291966 "2014-08-25T10:34:26Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [August 25, 2014, 10:34am UTC](https://forums.unrealengine.com/t/4-3-sending-a-fquat-over-network-without-setting-it-to-a-variable-crashes-the-game/291966/1 "2014-08-25T10:34:26Z")

</div>

Dear Friends at Epic,

This is one of those really odd network bugs!

#Server Function

```
UFUNCTION(reliable, server, WithValidation)
void SERVER_SetGoalRotation(FQuat NewRot);

```

#This crashes the Game

```
SERVER_SetGoalRotation(Dir.Rotation().Quaternion());

```

#This Doesnt

```
const FQuat Yipeee = Dir.Rotation().Quaternion();
SERVER_SetGoalRotation(Yipeee);

```

#Log

Log just states the line number, no useful info, its one of those new-window crashes, no actual useful log info

#Why?!

I have no idea why just this small change prevents game from crashing and makes everything work!

Why would a non variable-ized FQuat crash the game when passed over network?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_53648559](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_53648559](https://forums.unrealengine.com/u/anonymous_user_53648559)\
**Post date:** [September 2, 2014, 7:50pm UTC](https://forums.unrealengine.com/t/4-3-sending-a-fquat-over-network-without-setting-it-to-a-variable-crashes-the-game/291966/2 "2014-09-02T19:50:55Z")

</div>

Are you certain SERVER\_SetGoalRotation is not taking a reference? If constructed inside the parameter list, this could cause an issue. In the second case, it still could be an issue if the function held onto the reference, but is less likely to crash (but still bad to do).

This is complete random guessing here 🙂

Without a callstack, this will be hard to diagnose. Can you run this under the debugger under development or debug, and see if it will produce a callstack?

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [September 14, 2014, 2:52am UTC](https://forums.unrealengine.com/t/4-3-sending-a-fquat-over-network-without-setting-it-to-a-variable-crashes-the-game/291966/3 "2014-09-14T02:52:01Z")

</div>

I am positive it was not by reference, but it is great to hear from you , as always!

I will look more into this soon as I can, but if anyone else sees this or can duplicate this let me know!

Also I was testing in 4.3 when this happened

#Thanks !

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [September 16, 2014, 10:13am UTC](https://forums.unrealengine.com/t/4-3-sending-a-fquat-over-network-without-setting-it-to-a-variable-crashes-the-game/291966/4 "2014-09-16T10:13:02Z")

</div>

#Reproduced in 4.4.1

I was able to reproduce this crash again just now!

#Test in Tick

I put this code in the Character’s Tick function!

#This Works

```
FQuat HappyQuat = GetTransform().GetRotation();
SERVER_SetGoalRotation(HappyQuat);

```

#This Doesnt

```
//Local Sends updates to Server!
SERVER_SetGoalRotation(GetTransform().GetRotation());

```

#Server Func

```
UFUNCTION(reliable, server, WithValidation)
void SERVER_SetGoalRotation(FQuat NewRot);
	
UPROPERTY(Replicated)
FQuat GoalRotation;

bool AFlightCharMovement::SERVER_SetGoalRotation_Validate(FQuat NewRot)
{
	return true; 
}
void AFlightCharMovement::SERVER_SetGoalRotation_Implementation(FQuat NewRot)
{
	GoalRotation = NewRot;
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Replication List
void AFlightCharMovement::GetLifetimeReplicatedProps( TArray< FLifetimeProperty > & OutLifetimeProps ) const
{
	Super::GetLifetimeReplicatedProps( OutLifetimeProps );

	//GoalRotation
	DOREPLIFETIME(AFlightCharMovement, GoalRotation);
	
}

```

#Crash

```
!Id:2f33e7f1183c0ad9152e06fe66b1204d

Access violation - code c0000005 (first/second chance not available)

Fatal error!

UE4Editor_GalaxyHeist!AFlightCharMovement::SERVER_SetGoalRotation() + 10 bytes [e:\ue4clients\scriptingscrub\galaxy\ghrepo\intermediate\build\win64\inc\galaxyheist\galaxyheist.generated.cpp:190]
UE4Editor_GalaxyHeist!AFlightCharMovement::Tick() + 797 bytes [e:\ue4clients\scriptingscrub\galaxy\ghrepo\source\galaxyheist\public\flightcharacter\flightcharmovement.cpp:322]
UE4Editor_GalaxyHeist!AFlightCharTurrets::Tick() + 14 bytes [e:\ue4clients\scriptingscrub\galaxy\ghrepo\source\galaxyheist\public\flightcharacter\flightcharturrets.cpp:128]
UE4Editor_GalaxyHeist!AFlightChar::Tick() + 23 bytes [e:\ue4clients\scriptingscrub\galaxy\ghrepo\source\galaxyheist\public\flightcharacter\flightchar.cpp:114]
```

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [September 16, 2014, 10:33am UTC](https://forums.unrealengine.com/t/4-3-sending-a-fquat-over-network-without-setting-it-to-a-variable-crashes-the-game/291966/5 "2014-09-16T10:33:05Z")

</div>

#FQuat Not Replicating in 4.4, Client-\>Server

Actually unlike 4.3 where it still worked if I do above workaround, in 4.4.1 it looks like FQuat is not replicating at all going from client back to server

it works great from server to client!

I know this sounds strange but I’ve just tested with an FRotator under the exact same conditions and the Rotator replicates both ways, unlike FQuat

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [October 10, 2014, 9:15am UTC](https://forums.unrealengine.com/t/4-3-sending-a-fquat-over-network-without-setting-it-to-a-variable-crashes-the-game/291966/6 "2014-10-10T09:15:39Z")

</div>

Epic?

?

Anybody?

😉

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_34ab444a1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_34ab444a1](https://forums.unrealengine.com/u/anonymous_user_34ab444a1)\
**Post date:** [October 10, 2014, 10:25am UTC](https://forums.unrealengine.com/t/4-3-sending-a-fquat-over-network-without-setting-it-to-a-variable-crashes-the-game/291966/7 "2014-10-10T10:25:22Z")

</div>

Just a shot in the dark, but might it have something to do with FQuat being 16 byte aligned?

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [October 18, 2014, 1:44am UTC](https://forums.unrealengine.com/t/4-3-sending-a-fquat-over-network-without-setting-it-to-a-variable-crashes-the-game/291966/8 "2014-10-18T01:44:31Z")

</div>

I’m not sure, I hope Epic fixes it!

Thanks for the input !

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [January 8, 2015, 9:03pm UTC](https://forums.unrealengine.com/t/4-3-sending-a-fquat-over-network-without-setting-it-to-a-variable-crashes-the-game/291966/9 "2015-01-08T21:03:19Z")

</div>

Hey -

Are you still seeing this same crash in the latest version of the engine? Let us know if you are and if so could you include the callstack and log files.

Cheers

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [January 15, 2015, 9:51pm UTC](https://forums.unrealengine.com/t/4-3-sending-a-fquat-over-network-without-setting-it-to-a-variable-crashes-the-game/291966/10 "2015-01-15T21:51:30Z")

</div>

Hi ,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.
