Clirex
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 2477 |
|
|
| 08 Feb 2016 11:32 PM |
So I'm making a third person camera, and as it stands, I have it so it sends 1 single ray-cast, and if it hits a part, and if the part can collide, it shrinks the viewing area to fit the room provided
however if its noncollidable, the camera viewing area doesn't shrink at all to avoid annoying confusion when, say, walking through a noncollidable door
so heres basically what i have
local Part, Position = workspace:FindPartsOnRay(ray, blah, blah)
is there anyway to make a findpartsonray with ignore list to avoid all noncollidable parts?
or do i have to shrink the position and change the values with a looping raycast?
i want to avoid looping raycasts because i can imagine it would lag
anyone have any sort of solution or equation for me?
i can guarantee that i will be bumping this post for eternity
as for equations, im going to provide you with some useful stuff straight from my code:
local Ray = Ray.new( Subject.Position, (PostCam.p - Subject.Position).unit * Zoom ) local Part, Position = workspace:FindPartOnRay(Ray, Char, false, true)
ask if you want anything else, help appreciated thanks |
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 08 Feb 2016 11:41 PM |
:v y'know you can just change the camera offset property O' the humanoid if you want a 3d person camera - that is if you don't want it to be 3rd person and have it locked into place.
Also there is a way to have an ignore list
workspace:FindPartOnRayWithIgnoreList()
here you go, if you want to get a list of all cancollide = false parts, you were need to make sure that they are all in a single model and call :GetChildren(), or you can iterate through the workspace and add them to a table if they are cancollide = false. The only problem is if the cancollide property changes after an object has already been or hasn't been added to the table.
In which case you would need a .Changed event hooked to them all up, and check if the property that changed was the cancollide one. |
|
|
| Report Abuse |
|
|
Clirex
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 2477 |
|
|
| 08 Feb 2016 11:50 PM |
definitely not considering either of those options
if you have anything else though id like to hear it
thanks |
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 08 Feb 2016 11:51 PM |
'if you have anything else though id like to hear it'
>you could always : not have a 3rd person camera xd |
|
|
| Report Abuse |
|
|
Clirex
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 2477 |
|
| |
|
Clirex
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 2477 |
|
| |
|
|
| 09 Feb 2016 05:12 PM |
| http://forum.roblox.com/Forum/ShowPost.aspx?PostID=183267896 |
|
|
| Report Abuse |
|
|
Clirex
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 2477 |
|
|
| 09 Feb 2016 05:46 PM |
so i got your function but im confused as to how to use it
it doesnt work the same as ray.new() and workspace:findpartonray |
|
|
| Report Abuse |
|
|
|
| 09 Feb 2016 06:39 PM |
No. The arguments are in the comments at the top. |
|
|
| Report Abuse |
|
|
Clirex
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 2477 |
|
|
| 09 Feb 2016 11:00 PM |
yeah i already read all of that
give an example please |
|
|
| Report Abuse |
|
|