|
| 20 Nov 2016 06:26 PM |
When I stand in front of a wall to try and spawn an object, instead of it spawning on top of the wall, it spawns inside of the wall so I can't see it. What am I doing wrong?
local IgnoreList = {Spawns, InvisWalls} local OldPosition = Torso.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)) local _, Ray = workspace:FindPartOnRayWithIgnoreList(Ray.new(OldPosition, Vector3.new(0, -99999999999999, 0)), IgnoreList) Model:SetPrimaryPartCFrame(CFrame.new(Ray.X, Ray.Y, Ray.Z) * CFrame.Angles(0, math.random(), 0) + Vector3.new(0, Item:GetExtentsSize().Y/2, 0)) Model.Parent = workspace |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
EgoMoose
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 2896 |
|
|
| 20 Nov 2016 07:40 PM |
It's likely because you are setting the CFrame. Try this method instead:
http://wiki.roblox.com/index.php?title=API:Class/Model/MoveTo |
|
|
| Report Abuse |
|
|
|
| 20 Nov 2016 07:57 PM |
How do I get the correct vector for this?
Model:MoveTo(Vector3.new(CFrame.new(Ray.X, Ray.Y, Ray.Z) * CFrame.Angles(0, math.random(), 0) + Vector3.new(0, Item:GetExtentsSize().Y/2, 0))) |
|
|
| Report Abuse |
|
|
|
| 20 Nov 2016 08:08 PM |
Why doesn't this get the vector3 correctly?
local Test = CFrame.new(Ray.X, Ray.Y, Ray.Z) * CFrame.Angles(0, math.random(), 0) + Vector3.new(0, Item:GetExtentsSize().Y/2, 0)
Item:MoveTo(Test.p) |
|
|
| Report Abuse |
|
|
| |
|