So i’m searching for help.
First of all, I want too explain what i’m doing, I’m working (or trying to) make a working flashlight using a prop that is actually a Spotlight, and it works perfectly using the code I’ll show in a bit, It correctly moves to the player’s position and also follows player’s looking direction, but the only issue is that if you start looking more to the left or the right, the light will start moving very crazy (even if the player isn’t moving the mouse at all), so, basically, it works perfectly, but for some reason it moves crazy when you turn 180º (let’s say). This happens even if it’s some random static mesh, it will start moving very crazy. This is the code:
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()
Like, I said, it works very well but the only issue is the one I mentioned above, hope you can help me