|
| 13 Jun 2015 07:41 AM |
Its kinda hard to explain
You know how in games like sandbox or build to survive _, when you select something you can see a faded version of it until you place it?
That's what Im trying to replicate. Survival games I think also do it (actually they're a better example).
If you need better explination then ask in the comments |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2015 08:05 AM |
clone the House from say ServerStorage or whatever, loop through the Children and set all of the Part's Transparency to .5 or something, then when u click set it to 0 :P simple...
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2015 08:09 AM |
but how can you make the model follow the mouse?
Im stuck on using the mousemove function... |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2015 08:17 AM |
Mouse.Move:connect(function() HouseModel:MoveTo(Mouse.Hit.p) end)
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2015 08:50 AM |
So this is what I have so far (The script is located in game.starterGUI.screenGUI.TextButton), and it is a local script.
script.Parent.MouseButton1Click:connect(function() game.Workspace.BrickHouse:Clone() for i, v in pairs (game.Workspace.BrickHouse:GetChildren()) do v.Transparency = 0.5 v.CanCollide = false Mouse.Move:connect(function() game.Workspace.BrickHouse:MoveTo(Mouse.Hit.p) end) end end)
It keeps saying however that mouse is an unknown global. I feel im missing the obvious. |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Jun 2015 08:58 AM |
^
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2015 09:09 AM |
Ok so I got the main objective of the script working - it does clone the house and follow the mouse.
But it is very, very laggy, and it doesnt seem to make the parts in the house transparent. Should I define the cloned house and use waitforchild to wait until all the parts are transparent before it follows the player's mouse? |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2015 09:10 AM |
Here's the script
script.Parent.MouseButton1Click:connect(function() game.Workspace.BrickHouse:Clone() for i, v in pairs (game.Workspace.BrickHouse:GetChildren()) do v.Transparency = 0.5 v.CanCollide = false local player = game.Players.LocalPlayer local Mouse = player:GetMouse() Mouse.Move:connect(function() game.Workspace.BrickHouse:MoveTo(Mouse.Hit.p) end) end end)
|
|
|
| Report Abuse |
|
|
|
| 13 Jun 2015 09:17 AM |
if v:IsA('BasePart') then v.Transparency = .5 end
and also, u don't have to define player and mouse inside script.Parent.MouseButton1Click :P
also, for the laggy part, I might make a function soon, to kinda smoothly move a Model to the targetPosition (with a slight delay, cos of the smoothness, ya know)
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|