I want to make flying in VR on a broom. I already have walking on a thumpstick but I dont know how to go about flying. I would like it to snap to the arm and when you put it in between legs it would snap there as well. When you release the broom it will just fall to the ground but I am not sure how to do it.
Love this idea! Getting the flying controls to feel intuitive in VR sounds like a fun challenge. Hope you get some good answers.
Hey there @Milkaska! Welcome to the community! From a high level the basic steps you’d need to follow (extended in a bit more detail from this post):
- Create a new pawn class BP for the broom
- Add a floating pawn movement component
- Assign the Input Mapping Context after Event Possessed
- Add movement input after the Triggered pin of your Enhanced Input Action for the movement
- Setup a method of interaction to possess the vehicle/hide your character and vice versa. (For example this getting in/out of a vehicle tutorial)
At this point you should be able to become the broom and “get off” of it. The last steps are the art pass. Creating animations for your character is somewhat out of scope for this little post, but if you have specific questions I can answer them, for now I’ll address the bits you already mentioned.
Making a “riding stance” animation for your character and placing a copy on the broom works in most use cases, but if they need to react like a character class (damaged, etc) and you don’t want to have a separate handling for the broom pawn, you may also be able to attach your character, but this implementation is a bit more complex. The hand snapping portion could be done with IK (inverse kinematics) but it’s probably better for a beginner to just create the animation and attach a skeletal mesh copy to the broom and hide it when you’re not on it.