Tuesday, 16 February 2016

PUN shooter #3 - Footprints and footsteps.

In the past couple of days I worked on scripts for footprints and footsteps. Also, proxies didn't play animation.

<> Velocity and collisions may report incorrectly for kinematic bodies updated over the network.

The tricky part was getting a good enough answer to the simple question, "is the avatar walking". This breaks down into "is the avatar moving" and "is the avatar grounded".


Since collisions report inaccurately we can't use OnCollisionStay() to tell us an avatar is grounded. Instead, use raycasting.

Surprisingly, speed reported via position sampling proved inaccurate enough that I had to average readings over time to get acceptable results.

No comments:

Post a Comment