generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: raycasting help

Previous Thread :: Next Thread 
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
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
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
20 Nov 2016 06:40 PM
b1
Report Abuse
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
20 Nov 2016 06:50 PM
b2
Report Abuse
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
20 Nov 2016 07:01 PM
b3
Report Abuse
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
20 Nov 2016 07:17 PM
b4
Report Abuse
EgoMoose is not online. 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
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
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
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
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
BloodLitch101 is not online. BloodLitch101
Joined: 13 Jul 2011
Total Posts: 941
20 Nov 2016 11:28 PM
anyone?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image