When I place my flower tip model in any place it looks like below in the photos
how do I want it to look like
I have been searching for a solution for that for so long and couldn’t find a way to do that
When I place my flower tip model in any place it looks like below in the photos
how do I want it to look like
I have been searching for a solution for that for so long and couldn’t find a way to do that
get the surface cframe of your rayhit using
local surfaceCFrame = CFrame.new(hitPos, hitNormal)
then make sure the flower model’s front face is in the direction you want it to face out
then set the model’s primary part cframe to that
if its a union or mesh just do the same without the primary part, just cframe
local surfaceCFrame = CFrame.new(hitPos, hitNormal)
hitpos is the Mouse.hit but what is hitNormal
if you are using a raycast all it is, is result.Normal
normal is a unit vector3
if you arent using a raycast i suggest you do to make it easier to get the normal
local RayCast = workspace:Raycast(RightHand.Position,(Character.RightHand.Position - Position).unit * -50 )
if RayCast == nil then return end
local surfaceCFrame = CFrame.new(RayCast.Position, RayCast.Normal)
local FlowerTip = Assets.FlowerTip:Clone()
PlayerData.GrapplingHook = FlowerTip
FlowerTip.Parent = workspace
ChangeCanColide(FlowerTip:GetChildren(),false)
--FlowerTip:MoveTo(Position)
FlowerTip:SetPrimaryPartCFrame(surfaceCFrame)
Like this ?
i believe so that would work, it works with my attachments for hit particles
Maybe because It’s not facing the direction I want it to face out, How can I know the front of the model
what is the front face of your model? whatever that is will be in the direction of the surface cframe
by looking at the pictures it looks like the front face is off to the side
place a decal inside the model, whatever face it highlights is the front face
select the decal then it will show it
didn’t work
but thanks for telling me about the raycast.normal thing because after I searched a lot I found some kind of solution
Thanks for helping me a little it to understand keywords I should search and Raycast.Normal