# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/sample-tutorial-03-flexible-gameplay-in-fortnite
# Local doc: epic-docs/documentation/en-us/fortnite/sample-tutorial-03-flexible-gameplay-in-fortnite.md
# Section: Complete Script
using { /Verse.org }
using { /Verse.org/Native }
using { /Verse.org/SceneGraph }
using { /Verse.org/Simulation }
using { /Verse.org/SceneGraph/KeyframedMovement }
using { /Verse.org/SpatialMath }
using { /Fortnite.com/Game }
entity_entered_example_component<public> := class<final_super>(component):
@editable
Keyframes:[]keyframed_movement_delta = array{}
var StartTransform:transform = transform{}
OnBeginSimulation<override>():void =
(super:)OnBeginSimulation()
if:
FortRoundManager := Entity.GetFortRoundManager[]
then:
FortRoundManager.SubscribeRoundStarted(OnRoundStarted)
OnRoundStarted():void =
set StartTransform = Entity.GetGlobalTransform()
if:
Mesh := Entity.GetComponent[mesh_component]
then:
Mesh.EntityEnteredEvent.Subscribe(OnEntityEntered)
spawn { PlayCowAbdcutionAnimation() }
PlayCowAbdcutionAnimation()<suspends>:void =
Entity.SetGlobalTransform(StartTransform)
Sleep(2.0)
Verse Library
verse
10 Complete Script
Handles round initialization and plays keyframed movement animations when entities interact.
extracted-snippets/documentation/en-us/fortnite/sample-tutorial-03-flexible-gameplay-in-fortnite/10-complete-script.verse
Sign in free to read the full source 🌴
This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.