#CFrame of Effect

6 messages · Page 1 of 1 (latest)

crisp abyss
#

Hello i might need professional help according my script. The script im talking about is for my Anime game that i wanted to do for fun with my friend for friends only. I ran into a small problem according the CFrame of the effect. I want the Effect to get cloned and put a little further to the front rather than inside the HumanoidRootPart. I'll show a picture to explain it a little further.

#

How do i do it so that the Effect spawns a little to the front like 5 studs instead of inside the HumanoidRootPart?

bold canopy
#

hi ! if you want to move something in front of a part (humanoidrootpart here), you can use lookVector property of CFrame, to get the direction of the CFrame

#

so lookVector = HumanoidRootPart.CFrame.lookVector
so you have HumanoidRootPart position, his direction vector, now you just do

local newPos = HumanoidRootPart.Position + (lookVector * YourValue)
your value is 5 here :)

#

newPos will be a position 5 studs in front of HRP

#

btw you should set the parent to workspace, after setting the properties