Strange scripting errors

While adding the moving platform script to different game objects I found some very peculiar behavior presenting itself. When I added the holder script to my small platform everything works like a champ. Hop up on the platform, take a ride, jump up and down, walk off and everything works fine. When I add the holder script to the other platform using a little fancier script for the movement all hell breaks loose. Objects that have no association what so ever with the other platform start moving, even on game object off in the distance. I was and still am stumped by all that movement. When I adjusted the holder script with a check to identify the object entering the trigger and only will be affected by an object it should be affected by e.g. the Player all that extra movement stopped and the script started trying to act as it should. There is still a small bug but I’ll get to the bottom of that. When I do I’ll expand on that bug and the fix.

Latest: depending on how I am moving the platform ‘moving’ or ‘Vector3.Lerp’, when I parent the first person or third person controllers will result in how the controller will act. If I ‘move’ the platform, parenting seems to have no effect. When I Vector3.Lerp the platform parent works just fine and the character controller follows along great. The first person controller behaves a little weird as in the camera changes position (probably because to the parenting but I’ll get that fixed as it is a minor problem. Now I have to figure a way to move the platform without using Lerp because I don’t like that movement, I want the movement more liner rather than damped as the Vector3.Lerp is. I have a couple if ideas but I’ll check the online documentation first.

Leave a Reply

Your email address will not be published. Required fields are marked *