"how to make an moving object in roblox" Code Answer's
You're definitely familiar with the best coding language Lua that developers use to develop their projects and they get all their queries like "how to make an moving object in roblox" answered properly. Developers are finding an appropriate answer about how to make an moving object in roblox related to the Lua coding language. By visiting this online portal developers get answers concerning Lua codes question like how to make an moving object in roblox. Enter your desired code related query in the search bar and get every piece of information about Lua code related question on how to make an moving object in roblox.
how to make an moving object in roblox
--[[ Aiden's Smart Code, make sure to learn from this and use it later on!
But before you copy this code you will need to do a few things, such as:
1. Insert an BodyPosition in the object.
2. Make an script in the object.
3. Make sure the object is just under Workspace.
There are multiple codes in here so make sure to get the right code!
--]]
-- Code 1, when a player joins the game the object will move:
local Object = game.Workspace:WaitForChild("Object Name Here")
local BodyPosition = Object.BodyPosition
game.Players.PlayerAdded:Connect(function(player)
BodyPosition.Position = Vector3.new(Coördinates in these brackets)
-- Use this if you want the object to move to another position after this!
wait(5) -- Change this number to how many seconds you want to wait.
BodyPosition.Position = Vector3.new(Coördinates in these brackets)
end)
-- Code 2, when a player touches another object, the object will move:
local Object = game.Workspace:WaitForChild("Object Name Here")
local TouchedObject = game.Workspace:WaitForChild("Touched Object Name Here")
local BodyPosition = Object.BodyPosition
function OnTouched(part)
BodyPosition.Position = Vector3.new(Coördinates in these brackets)
-- Use this if you want the object to move to another position after this!
wait(5)
BodyPosition.Position = Vector3.new(Coördinates in these brackets)
end
TouchedObject.Touched:Connect(OnTouched)
--[[ This is all there is, i hope you will have learned from this code
and that you will use it soon in your games!
If you'd like to thank me you can do this:
1. Learn from this code and become a better programmer!
2. Like this code!
3. Make an successfull game!
--]]
All those coders who are working on the Lua based application and are stuck on how to make an moving object in roblox can get a collection of related answers to their query. Programmers need to enter their query on how to make an moving object in roblox related to Lua code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about how to make an moving object in roblox for the programmers working on Lua code while coding their module. Coders are also allowed to rectify already present answers of how to make an moving object in roblox while working on the Lua language code. Developers can add up suggestions if they deem fit any other answer relating to "how to make an moving object in roblox". Visit this developer's friendly online web community, CodeProZone, and get your queries like how to make an moving object in roblox resolved professionally and stay updated to the latest Lua updates.