Hi, so what I’m trying to do is make a working flashlight (because the already existing one isn’t cool to me), and what I’ve got so far is the prop following the player’s location and the view rotation, so if i look to one place the flashlight will look at the same place, but for some odd reason (That I don’t understand) the spotlight (or any other mesh) will start moving very crazy when looking to the left or to the right, in the video we’ll see the light flickering but that’s fine due to the 0.2 delay. In the video you’ll see a moment where the light will be gone and will start to move very crazy. I have removed any type of collision to this Prop but still got no solution. The light follows the player correctly but the viewrotation has some odd thing that I just explained. You can check the following video and the code below is the one I used.
(Sorry if the video quality isn’t that great…)
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Fortnite.com/Characters }
using { /UnrealEngine.com/Temporary/SpatialMath }
source_light := class(creative_device):
@editable
FollowerProp : creative_prop = creative_prop{}
DoFollowPlayer()<suspends> : void =
loop:
if (PlayerList := GetPlayspace().GetPlayers(), FortniteCharacter := PlayerList[0].GetFortCharacter[]):
PlayerPosition : vector3 = FortniteCharacter.GetTransform().Translation
FollowerProp.MoveTo(PlayerPosition, FortniteCharacter.GetViewRotation(), 0.2)
else:
break
Print("Follow")
OnBegin<override>()<suspends>:void=
DoFollowPlayer()