Dynamic Material
For the first Blueprint, I created a Dynamic Material Instance using the Construction Script. I stored the material instance in a variable so I could change its parameters during gameplay.
In the Event Graph, I used the G key to control the material. A Flip Flop switches between two values:
- First press: Emissive changes to 50
- Second press: Emissive changes back to 0
This allows the material to change dynamically when the player presses G.
Interactive Gate
For the second Blueprint, I created a gate that opens when the player enters a trigger volume.
The Blueprint uses Begin Overlap to detect when the player enters the trigger and End Overlap when the player leaves. I also used a cast to make sure the actor entering the trigger is the player.
I used a Timeline to control the gate's movement. The Timeline works with Lerp nodes to smoothly transition the gate between its closed and open rotations.
Player enters → Gate opens
Player leaves → Gate closes
What I Learned
This assignment helped me practice:
- Dynamic Material Instances
- Blueprint events and input
- Trigger volumes
- Timelines
- Lerp nodes
- Object rotation
- Creating interactive elements in Unreal Engine 5
No comments:
Post a Comment