Hello I have been having an issue, currently I’m trying to make out to the Platformer game on unity, and I want something to happen, when a character gets near close to an item or an NPC and click a certain button in this case F it would play a cut scene
Now i figured out the interaction part
But how do i make it play a cutscene since in most videos they make the cutscene in game but mine is already made externally so it’s a video that I want to import into unity
And when the video ends we go back to where the character was standing and it doesn’t reset their position to the beginning, cuz that happened. And i left it and closed the program and next day started working and its somehow started playing the cutscene at when i opened the game
I Desperately need some guidance here cuz im lost
To achieve your desired behavior in Unity—playing an externally created cutscene video upon interaction and resuming the game state correctly—you can use Unity’s VideoPlayer component in combination with scripting. Here’s a step-by-step guide to help you:
Import the Video into Unity
Drag your video file into Unity’s Assets folder.
Select the video and ensure its settings are correct in the Inspector (e.g., make sure it is set as a Video Clip).
Create a Video Player
Add a VideoPlayer Component:
Create an empty GameObject in your scene (e.g., CutscenePlayer).
Add the VideoPlayer component to it (Add Component > VideoPlayer).
Drag your video file into the Video Clip field of the VideoPlayer.
Set Playback Options:
Set the Render Mode to Camera Near Plane or Render Texture (if you have a UI setup).
Enable Play on Awake only if you want to preview it during setup (disable it for runtime).
3. Script the Interaction and Cutscene Playback
Create a script to handle the interaction and ensure the game resumes correctly after the cutscene.