#[Im Stuck] The simulated proxy sees the wrong weapon swapped

1 messages · Page 1 of 1 (latest)

stone fern
#

btw I'm on version 5.1 so will it help if I update Unreal?

broken lark
stone fern
#

roll back to what version?

#

It worked on this current version

#

idk why I thought about updating I just don't have any idea about how to fix this

broken lark
stone fern
#

oh

#

but I added stuff

broken lark
stone fern
#

a bit

#

btw on the server its fine

broken lark
stone fern
#

yeah probably

stone fern
#

just saw that during the solution for my previous bug, I accidentally removed the stuff for reloading locally

#

maybe thats what is causing the issue

#

testing

#

ok

#

Good news

#

I almost fixed it

#

the only problem now

#

is that the second client sees the wrong weapon when Im swapping, any ideas?

stone fern
#

here it was LocallyReloading() instead of LocallyControlled() ok I will see if thats the problem

#

nope

#

its not

#

but I will keep searching

#

lets see

#

its not really related to the problem

#

but

#

I will check if it works anyway

#

nope

#

ok\

#

more searching

stone fern
#

added this

#

maybe its the problem

#

at least the animation aspect of that

#

ok

#

1 step closer!

#

the animation stuff is fixed

#

now I just need to figure out the solution about the wrong weapon swapping for the other client (not a locally controlled client)

#

Saw the whole lecture again and still, I have the problem

#

so does anyone want to help please?

rustic horizon
#

is your simulated proxy seeing the new weapon in the hand and then seeing the swap animation? that's the problem I'm having at the moment!

stone fern
#

Yes but then after I swap I get the wrong weapon because I’m already with the new one

#

Actually

#

When I will be home I will send a video that it will be clearer about what my problem is after some fixes

stone fern
#

ok Im not sure that we have the same problem but here is the video

rustic horizon
#

it's like your sim proxy is calling swap weapon twice

stone fern
#

hmm

#

how can he call swap twice?

rustic horizon
#

hmm i'm not sure, but on that 3rd time you swapped weapons, it swapped and immediately swapped back, then causing the issue

stone fern
#

I'm calling it twice

#

Something from my previous problem

#

and here

#

but I call it in 2 different cases

#

I will debug

stone fern
#

lol when I'm on debug mode its swapping to the right weapon on the simulated proxy, when I'm out of it the sim proxy gets the wrong weapon

stone fern
#

ok I have literally no idea it calls SwapWeapon() just once and when I continue after the breakpoint it swapping to the right weapon.
When I dont have a breakpoint or im just running the game its not working (swaps to the wrong weapon)

stone fern
#

Any idea?

rustic horizon
#

the only difference I have is that I call Combat->SwapWeapons() above PlaySwapMontage() , but mine doesn't work for sim proxies so unfortunately I have no idea 😦

stone fern
#

you are calling PlaySwapMontage() and Combat->SwapWeapons()?

#

on the same function?

rustic horizon
#

yeah, I noticed my clients were swapping weapons THEN playing the montage, so I called the swap weapon function and it works correctly now

#

it's just simulated proxies that are still having that issue, seeing the change of weapon before to montage has played

stone fern
#

I thought only the server needs to handle it

rustic horizon
#

I am yeah, the client was swapping weapons before the montage, so was holding the new weapon when it hadn't swapped yet, this seemed to fix that issue

stone fern
#

before the local player logic

stone fern
#

I don’t think we have the same issue for me is the simulated proxy see the wrong weapon swapping on the client and I have no idea how to fix it.

stone fern
#

so does anyone know how to fix this?

stone fern
#

ok I will watch the swap lecture again

#

maybe I will find something

stone fern
#

When I swap weapons the simulated proxy see the wrong weapon of the client (didn't happen before).

#

ok

#

[L209]swap weapons the simulated proxy see the wrong weapon of the client (didn't happen before).

#

I saw the whole lecture again (174 - SwapWeapons) and I didn't find anything so I guess Im stuck and I have no idea what to do.
Its weird that it doesn't work only on the sim proxy and it works on everything else.
also I have no idea how it worked when I breakpointed the swap function.
so yeah, I need your help people.

#

3 bugs in a row is funny lol

#

L209 - When the client swaps weapons the simulated proxy sees the wrong weapon swapped.

stone fern
#

When the client swaps weapons the simulated proxy sees the wrong weapon swapped.

#

The simulated proxy sees the wrong weapon swapped

stone fern
#

I added !Character->HasAuthority()
to: ```c++
if (CombatState != ECombatState::ECS_Unoccupied || Character == nullptr || !Character->HasAuthority()) return;

On the `void UCombatComponent::SwapWeapons()` function.

And maybe it's better? I cant tell
Still not working. 
I am literally clueless, please help.
stone fern
#

[Im Stuck] The simulated proxy sees the wrong weapon swapped

stone fern
#

I think I will open a new post and delete this because so much happened that it will be hard for other to understand and help me so yeah I will do this when I will be home.

lucid rivet