Professional Documents
Culture Documents
Лаб8КомпГрафіка
Лаб8КомпГрафіка
Лаб8КомпГрафіка
2022
Порядок виконання:
Part 1:
Using the base project for this week, add haptic feedback to the lever.
Because the Hand variable is private, you need a way to access it in other
Blueprints.
1. Call Get Player Controller to get a reference to the local player controller.
2. Drag off the return value for this node and call the Play Haptic Event
function.
3. Select the Haptic Effect you created as the Haptic Effect input to this node.
4. Get a reference to the Current Interactor Component variable, call the
Get Hand function on it and pass the output to the Hand input of the
haptic effect.
Part 2:
1. Using the project from the previous exercise as a base, create a new
Blueprint based on an Actor named InteractiveDrawer and place it in the
InteractiveObjects subfolder.
To represent the mesh of the drawer, a static mesh has been created using a
third-party tool.
2. Drag the Drawer mesh from the Meshes folder into the Blueprint’s
Component hierarchy. Make sure to enable Physics on this Static Mesh
Component.
3. Create a new Physics Constraint Component and set the Component
Name 1 to Drawer.
This ensures that the constraint affects the drawer mesh.
4. Set the XMotion Linear Limit to Limited and the Limit to 20.
This ensures that the drawer can only move in the local X direction by 20
units.
5. Expand the advanced options on the Linear Limits section and set the
Restitution to 0.05.
9. Open the On Drag End interface function and check that the Interactor
input equals the Current Interactor variable. If true, then call the Release
Component function on the physics handle. (figure 7)
This makes it so only the hand that is moving the drawer can release it.
1. Open the On Drag Interface function and check that the Current
Interactor variable is the Interactor input. If true, then call the Set Target
Location function on the physics handle and pass in the world location of
the Current Interactor variable.
This updates the physics handle’s location every frame that you are dragging
the drawer.