Does anyone have a script for zero-G camera movement?

What I mean is camera movement that assumes no direction of “down”, allowing unlimited turning in any direction as well as rotation with Q and E buttons.
Like in Space Engine.
I need it for a stupid Eyewitness meme game, but I have no idea how to control the camera in Roblox.

2 Likes

Does it need to be attached to the character still?

1 Like

It would be ideal if it moved the character based on camera orientation, if that’s what you mean.

1 Like

once you want a zeroG cam instance a part by size 1,1,1 insert a body velocity and a body gyro.
then focus the cam on the look vector of the part. the gyro is where the user is looking, the bodyvelocity is the movement that is controlled using the inputservice system.

2 Likes

Here you go.

The game is uncopylocked. The scripting and functions are archaic and I had to fix them in a very hacky manner, but it’s at least something you can use for the time being. The controls for the movement are in the description, or you can just play like you would Space Engineers and hold F for dampeners. The script has a few settings you can mess with too.

5 Likes

I made one myself long ago, but I can’t find it.

which is sad, as it had flight, and allowed me to walk on (and jump off) any surface, as long as it’s “below” my feet (in the direction my legs are pointing)

1 Like

One of the ideas is to create a local part (non collidable, transparency = 1) and attach the camera to it through this snippet, or equivalent:

Disclaimer: This snippet was actually given to me by a friend of mine, props to him :slight_smile:

local function setCam(cameraPart)
	local cam = workspace.CurrentCamera
	cam.CameraType = Enum.CameraType.Scriptable
	cam.CameraSubject = camera
	runService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value - 1, function()
		local rotation = camera.CFrame - camera.Position
  		cam.CoordinateFrame = CFrame.new(camera.Position)*rotation * CFrame.new(0,0,-camera.Size.X/2 - .1)
	end)
end

setCam(c) -- c is the part you created

The advantage of this is that this way, as you manipulate the part you’re also manipulating the camera. One interesting application is attaching a weld to said part and manipulate the weld itself.

2 Likes

It’s hackish, but it does exactly what I wanted which is impressive.
I’ll see if I can deal with the instabilities.