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: Brick in front of player

Previous Thread :: Next Thread 
Roblok1 is not online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
08 Mar 2016 07:35 PM
How do I detect if a player is in front of a brick or not? What do I have to do? Just the logic will do. Dont worry about adding protection.
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
08 Mar 2016 07:36 PM
Raycasting?
Report Abuse
Roblok1 is not online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
08 Mar 2016 07:46 PM
How do I use raycasting to do this?
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
08 Mar 2016 07:48 PM
local p = workspace:FindPartOnRay(Ray.new(brick.Position, brick.CFrame.lookVector * 100))
if p and game.Players:GetPlayerFromCharacter(p.Parent) then
-- p.Parent is the character, p is the arm/leg/whatever was in front of brick
end
Report Abuse
Roblok1 is not online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
08 Mar 2016 10:03 PM
so, is there like a property or a return value that tells you which face its coming from?


Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
08 Mar 2016 10:03 PM
I'm shooting the ray FORWARD from the part
Report Abuse
Roblok1 is not online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
08 Mar 2016 10:06 PM
oh i get it! so the value P is what Part the Ray is touching?


Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
08 Mar 2016 10:06 PM
Yeah, the part that the ray intersected
Report Abuse
Roblok1 is not online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
08 Mar 2016 10:07 PM
well thanks then.


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