Unity FirstPersonShooter animation issue

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

Posts: 1
Joined: 01 Feb 2018, 19:22

Unity FirstPersonShooter animation issue

Postby Venomxd » 14 Feb 2018, 20:42


I'm having a little trouble and I was hoping someone on here could help me out (sorry if this is the wrong place to post this). I don't know much about game development, so I figured I'd download the SmartFoxServer Unity examples and mess around with them to learn some. So I messed around with the FirstPersonShooter example and added a few things to it. However, after adding several things (running, cooldown buttons, gui displays, etc.), I realized an issue had developed in the process. Whenever an enemy moves, the running animation doesn't play, and as a result it looks like the player is teleporting around.

I'm not sure what could be causing this. There are no errors, warnings or anything in the console. The server is successfully sending an enemy transform request to the client. The client tries to play the animation after getting the request. The enemy running animation seems to work (if I just add the animation to the game instead of doing it through the code, the animation plays fine). I didn't change anything in NetworkTransform.cs or AnimationSynchronizer.cs. So I'm not sure how to debug this problem or what to do next.

I've attached some gifs showing the problem and what it should look like (from the unmodified examples).

(151.33 KiB) Not downloaded yet

(141.99 KiB) Not downloaded yet

If any of you have any ideas or suggestions on how I can fix this, I would greatly appreciate them.

Thanks for your time.
User avatar
Site Admin
Posts: 20541
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Unity FirstPersonShooter animation issue

Postby Lapo » 15 Feb 2018, 11:25

I would probably try to debug the part where positional updates arrive at the client and check what's happening in terms of animation. What is particularly weird is that the enemy disappears and reappears abruptly.

If the debugging doesn't help I would suggest to download the original copy of the example and compare the source with the changes you've made. The character interpolation is a bit complex and messing with its logic can cause weird behaviors.

Keep in mind that we also have a detailed tutorial on how it works:
http://www.smartfoxserver.com/downloads ... hrough.pdf

...addicted to flash games

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 4 guests