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 » Scripting Helpers
Home Search
 

Re: Instance.new at the Position of the Mouse

Previous Thread :: Next Thread 
TheJKM98 is not online. TheJKM98
Joined: 20 Dec 2010
Total Posts: 511
14 Jan 2014 07:52 PM
I have this:

local player = game.Players.LocalPlayer
local tool = script.Parent
local mouse = player:GetMouse()
local thing = Instance.new("Part" , game.Workspace)

function blah()
thing.CFrame = CFrame.new(thing.Position , mouse.Hit.p)
thing.Name = "THING!"
thing.Anchored = true
thing.Size = Vector3.new(20 , 1 , 20)
print(thing.Position)
end

tool.Activated:connect(blah)

It prints the position, but nothing is actually created.

Did I miss a step, or what?
Report Abuse
jeremycoolbou is not online. jeremycoolbou
Joined: 29 Jan 2013
Total Posts: 462
14 Jan 2014 08:09 PM
Set it's position to where the Mouse hits. Try this:

thing.Position = mouse.Hit

I'm pretty sure you need to use CFrame in order to access the hit property of Mouse, but tinker with it.
Report Abuse
TheJKM98 is not online. TheJKM98
Joined: 20 Dec 2010
Total Posts: 511
14 Jan 2014 08:36 PM
Yeah, I figured it out
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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