Hello everyone! Quite new to Unreal Engine and I am having a little headache with one thing and I haven’t found answers by Googling around or by watching lots of YouTube videos.
–
So I am making a children’s game that is going to have moving stuff (swings, carousels, rollercoasters). The issue is that I am not sure how to attach player properly to these moving components.
See the video below about my issue for the swing:
–
So the question is - how would I properly attach a character to a moving object? Below is image of what I have setup now… It’s result of trial and error and so far the best option, but position is quite off. I figured maybe I could set relative position or something for the player, but it can get quite messy in terms of how the nodes would look. What would be simple but efficient way to implement what I am trying to do?
Hey there @bbls1! Welcome to the community! I think what you need to do is snap the rabbit to the seat, and disable the player movement, and consolidate the logic.
Do you have 2 timelines? One on the swing and one on the rabbit? If so;
In your attach actor to component node, set it to snap to target for the rules, and then only run the timeline on the swing component, the rabbit will follow it because it’s an attached actor as it’s child, which would make your timeline on the rabbit itself redundant.
Great! Whenever having players mount/ride in vehicles like the swing, if you don’t disable movement it will be able to run off. Bonus tip: If you ever require your player to be in a vehicle like the swing but still have access to the inputs, it’s best to attach this way. However, if you need to be in a vehicle that handles it’s own locomotion like a car for example, it’s often better to possess the vehicle actor. Though there are some exceptions.
Thanks for the tips! I actually just figured this out last night as well when trying to make a possessable cannon that player can turn with and then launch themselves to air