Hi.
I am using the first person character from the downloads section.
When i parent it to a moving platform using object->set parent action. It only honours the parent position if I dont move the player. As soon as I move in any direction it loses the parents position and the player moves as if it was not on a platform until i let go of an direction input.
tia
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
may be worth noting that im using moveable component on the platform
i ended up writing my own script to move the platform. I think the moveable component is doing something to mess with the players velocity. Im guessing it wasn't intended for this use case.
How are you moving the platform in your script vs the Moveable component? Did the latter have "Move With Rigidbody" checked?
in my script nothing too special just using Vector3.Lerp(initialPosition, targetPosition, t);
i did try with move with rigid body but it didnt work.
now i have come back to it and retested with moveable and AC actions and now its working as expected. So not sure whats going on. having move with rigid body makes no difference, seems to work.... and i cant seem to replicate the issue now. haha
I did recreate this issues. Seems to do things differently after a unity restart.
So for example.
Object doesnt not have a moveable. then i add the moveable. - works fine.
Restart unity - press play and then the issue occurs.
remove the moveable restart unity and add the moveble back and then its fine again until i restart unity.
It may be a Unity issue, in that case. What Unity version/platform are you working with, and are you saving the project before restarting?
If you can create a .unitypackage file or project .zip that has all the files necessary to demonstrate the issue, PM it to me and I'll take a look.
Rather than parenting the Player to the Moveable, attach this script to the Moveable instead:
Thanks. That does seem to do the trick. had to increase the time update in project settings as the default was a bit jittery.
appreciate the help
To get rid of the jitteriness, try this one instead:
cheers