Get Cframe, adjust it, then apply it

Hey,
Imma start by explaing what i’m trying to do.
I have 2 parts. One is the “Guide” part that has the position the second part has to go to.
When a player clicks a button the second part cframe should become the Guide cframe without changing only one value, the position,Y value.
Pratically after the button click i should change the second part cframe to the first part one, but the position.y value should be the second part one, this value shouldn’t change.

I have a script i’m trying to use for this, but it doesn’t work

local Posizione = Tycoon.Posizione.CFrame
Posizione = CFrame.new(Vector3.new(Posizione.X,Punto.Touch.CFrame.Y,Posizione.Z),Posizione.Rotation)
Punto:SetPrimaryPartCFrame(Posizione)

Thank you all!

Fixed it!

--Cframe
		local Posizione = CFrame.new(
			Vector3.new(Tycoon.Mobili:GetAttribute("X"),Punto.Touch.CFrame.Position.Y,Tycoon.Mobili:GetAttribute("Z")),
			Vector3.new(0,0,0)
		)
		--Sistema il modello del punto esclamativo
		Punto.Parent = Tycoon.Mobili
		Punto:SetPrimaryPartCFrame(Posizione)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.