How to keep part orientation after connecting to Motor6d?

(Sorry for my english i’m using google translator)

Hello, i’m working on a projectile that fires when mouse is pressed and i made a script to when it dectets that a part touched it and the part isn’t part of a character the script creates a motor6d that connects the projectile and the part that touched it, and worked but the projectile orientation was not as before, when it was fired, then i searched a bit in devforum and in the roblox api and the solution i found was changing the C0 to the old projectile CFrame (before it get touched) but the part teleports to a random position that i can’t see where.

Without setting the C0 the part still teleports to a random position, but it’s just sometimes.

How can i keep the part orientation when i create the motor6d? There is a better way of keeping the projectile CFrame?

Setting C0:

Without setting it:

Code:

if Debounce and Comparar(Touch, false, NotParts) and Touch.CanCollide then -- Is not part of a character

		Debounce = false

		if script.Parent:FindFirstChild("BodyVelocity") then

			script.Parent.BodyVelocity.Velocity = Vector3.new(0, 0, 0)
			script.Parent.BodyVelocity.Parent = nil
		end

		local Motor6d = Instance.new("Motor6D")
		
		Motor6d.C0 = script.Parent.CFrame -- sets C0
		Motor6d.Parent = script.Parent
		Motor6d.Part0 = script.Parent
		Motor6d.Part1 = Touch
		
		wait(5)

		script.Parent.Parent = nil 
	end

Save the existing (original) value of its Orientation property (is a Vector3 value) and then reassign it after the Motor6D instance has been attached.

Oh, thanks, this worked, but i have another issue, i want the projectile to stay at the exact position that it hits but when i create the motor6d the part goes to the center of the part.

I already made this before but i used mouse hit p and an obstacle can get out of the way and then the projectile would stay anchored mid air, i also tried to take the mouse hit p when it hits, but i can change the mouse position before the projectile hits somethin and the the projectile teleports to it, any idea of how to do this?