@Skaldarnar you make a good point. The only entity updated should be the current one since we don't want setting the speed twice. The snippet technically would do nothing different (since there are no additions, just setting of speeds), but there would be redundancy. Synchronizing the two is an option that could do a check to see if their velocities have already been set to opposite directions.
Besides this, there could be some minor improvements in performance by not getting Rigidbody and Rail components until after we do the character check and nullcheck. We might also be able do disable the players's rigidbody while he's inside the cart so there isn't an event of that sort sent every frame?
Besides this, there could be some minor improvements in performance by not getting Rigidbody and Rail components until after we do the character check and nullcheck. We might also be able do disable the players's rigidbody while he's inside the cart so there isn't an event of that sort sent every frame?
Last edited: