#Im trying to make a kamui dimension where when you travel in the dimension it is 10x more distance

1 messages · Page 1 of 1 (latest)

desert stratus
#

like the minecraft nether?

mint topaz
#

10x walkspeed

red barn
#

Whenever the player goes in the dimension, save that vector3.

Whenever they leave, take their new vector3 position and do this calculation:

local Player: Player -- I assume you have the player already
local Character = Player.Character or Player.CharacterAdded:Wait()
if not Character then warn("Character not found"); return end
local HRP = Character.PrimaryPart or Character:FindFirstChild("HumanoidRootPart")
if not HRP then warn("RootPart not found"); return end

local DISTANCE_SCALE: number = 10

local OldPosition: Vector3 = HRP.Position -- = Whatever the position they entered the portal in is

-- Player leaves portal:
--------------------------

local NewPosition = HRP.Position

-- Final - Initial
local Displacement: Vector3 = NewPosition - OldPosition
local Distance: number = Displacement.Magnitude
local Direction: Vector3 = Displacement.Unit

local ScaledDistance: number = Distance * DISTANCE_SCALE
local FinalPosition: Vector3 = OldPosition + (Direction * ScaledDistance)

-- set the cframe (aka the position, but includes rotation)
HRP.CFrame = CFrame.new(FinalPosition)
#

also, if the player suddenly goes super high in the sky, you can ignore the Y axis when multiplying and just set it to the Y axis the player was at when they went in.

wheat holly
#

Thanks