Trying to fix weird offset when part collides with anything

How it should be when it collides with a part:
image
how it is when it collides with a part:
image

Basically I have a part that tweens to the camera’s orientation, and whenever it collides with the ground, or anything, it messes up and creates a offset of some sort, and it doesnt face the camera’s orientation anymore.

Code:

	local camOrientation = Camera.CFrame-Camera.CFrame.Position;

	local tweenInfo = TweenInfo.new(1)
	local tween = ts:Create(Scanner, tweenInfo, {CFrame = CFrame.new(Scanner.Position)*camOrientation})
	tween:Play()

Can you not just turn off CanCollide and turn Anchored on?

1 Like

It has to collide, and it has to have anchored off, it’s a drone that flies around the map, i cant have it clip through the map

Have you tried using something like a AlignOrientation to restabilize it after it hits something?

seems interesting, but i feel like thats a bad practice, i was thinking of using a bodygyro, and make a equation of some sort to make the bodygyro face the camera’s orientation
image

but i dont know how to make the equation, can anybody help?
current code:

local camOrientation = Camera.CFrame-Camera.CFrame.Position;

	local tweenInfo = TweenInfo.new(1)
	local tween = ts:Create(Scanner, tweenInfo, {CFrame = CFrame.new(Scanner.Position)*camOrientation})
	tween:Play()

would appreciate a reply on this.

can somebody help. me here at all

why would that be bad practice?

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