Strange things with CFrames

Hello everyone. I am trying to make a rocket system, but I can not figure out, why when I change x it goes up and when y it goes x?

local part = script.Parent
local go = true
local y = 1
local degreec = 0
game.Workspace.Baseplate.Touched:Connect(function(hit)
	if hit.Name == "Rocket" then
		hit:Destroy()
		go = false
	end
end)

while y <= 100 do
	part.CFrame = part.CFrame:ToWorldSpace(CFrame.new(0, 1, 0))
	task.wait(0.01)
	y += 1
end
2 Likes

Check the pivot point. Since you have simple part’s you can just rotate the part so that Y-axis is pointing up and resize the part. Or optionally change the pivot orientation/reset pivot.

3 Likes

I’d like to do it with CFrame, because I will rotate it i the sky.

1 Like

I mean that you resize the rocket part in studio, not while game is running.

2 Likes

wouldn’t it be better to just tween the rockets and then manipulate them further?

also please use dark mode thank you very much :grin:

1 Like

They get cloned from ReplicatedStorage. There is a remote event.

1 Like

Client

local UserInputService = game:GetService("UserInputService")
local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")

UserInputService.InputBegan:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 and Mouse.Target == game.Workspace.Button then
		print("click")
		RemoteEvent:FireServer()
	end
end)

Server

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
local Rocket = ReplicatedStorage.Rocket
local Positions = {CFrame.new(-3, 3, -37), CFrame.new(1, 3, -37), CFrame.new(5, 3, -37), CFrame.new(9, 3, -37), CFrame.new(13, 3, -37)}
RemoteEvent.OnServerEvent:Connect(function(player)
	for i, v in Positions do
		local a = Rocket:Clone()
		a.CFrame = v
		a.CFrame = a.CFrame * CFrame.Angles(0, math.rad(90), math.rad(90))
		a.Parent = game.Workspace
	end
end)
1 Like

To tween them you mean to use TweenService?

1 Like

correct charrrrrrrrrrrrrrrrrrrr

1 Like

Sorry, but what is charrrrrrrrrrrr?

1 Like

it just allows me to reply because normally you need atleast 30 NARRATIVE ENTITIES (is roblox gonna let this through??) in a reply

1 Like

Resize the rocket model so that size is smth like: Size: {1, 3, 1}

1 Like

It still doesn’t helpppppppppppp.

1 Like

Because Different LookVector when you Create Cylinder or Block

1 Like

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