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 |
|
|
| |
|
Roblok1
|
  |
| Joined: 27 Jul 2011 |
| Total Posts: 2019 |
|
|
| 08 Mar 2016 07:46 PM |
| How do I use raycasting to do this? |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 08 Mar 2016 10:03 PM |
| I'm shooting the ray FORWARD from the part |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 08 Mar 2016 10:06 PM |
| Yeah, the part that the ray intersected |
|
|
| Report Abuse |
|
|
Roblok1
|
  |
| Joined: 27 Jul 2011 |
| Total Posts: 2019 |
|
| |
|