problem updating character position after switching characters

Updated on July 19, 2017 in [A] C# .Net
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
4 on July 17, 2017

Heya all, first let me say thank you for the views.

 

I followed Bracky’s tutorial for switching weapons, but used it to switch between three players that were children on an empty game object.  The method works, and I am able to switch between the characters with no difficulty.

 

The problem is that the player control is on the characters, and not the empty game object, so when the characters move, and are then switched…the characters jump. 

 

I have tried to store position and rotation data and pass it to the character transform when it is enabled, but am having no luck.

 

Any suggestions would be very helpful.

  • Liked by
Reply
2 on July 17, 2017

maybe consider disabling the character contoller,

(something like: GetComponentInChildren<“Name”>().enabled = false;)

and enable it again when selecting.

or re-map the jump key?

on July 17, 2017

By jump I mean that the characters do not move together when controlled. When you switch characters they are not in the same place so they they look like they jump to a different position. I have tried different methods to try to align them before they are enabled, but have been unsuccessful.

on July 17, 2017

Maybe it would be more accurate to say it looks like they “pop” to different positions when you change characters.  I know why it is doing that, just not how to correct the position in the for loop.

Show more replies
  • Liked by
Reply
Cancel
0 on July 19, 2017

Bump

  • Liked by
Reply
Cancel