What do you want to achieve? Keep it simple and clear!
I want to fix my script that I made to attach a part to an attachment with the same orientation.
This is my script:
local floorCframe = RaycastInstance.CFrame * CFrame.new(attachment.Position)
local emptyVector = Vector3.new(0,0,0)
local attachmentWorldUpvector = attachment.SecondaryAxis
local attachmentWorldRightvector = attachment.Axis
local goalRotationCFrame = CFrame.fromMatrix(emptyVector,attachmentWorldRightvector,attachmentWorldUpvector)
floorCframe = floorCframe * goalRotationCFrame
floorCframe = floorCframe * CFrame.new(-Structure.FloorAttachment.Position)
Structure.CFrame = floorCframe
And this is what happens sometimes (It doesn’t work) :
What is the issue? Include screenshots / videos if possible!
Sometimes It works and sometimes it doesn’t and I don’t know why.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried Devforum and YT
I took this script from this post : How to rotate part according to attachments orientation
I made it work to mine and it still doesn’t work sometimes. But in that post the guy uses mouse position, not raycasting and I am using raycasting. Idk if that has something to do with it. Please respond quickly as I need to get this done asap. Thank you for your time.
Im still confused on the issue, is it not snapping in the correct place? Just a still image cant really give people an idea of what the problem looks like
I cant, i want it to rotate in the placing stage, but also it should work, but it just doesnt some times. There has to be an error somewhere because it cant just work sometimes and others not.