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
 

Raycast difficulties [pls read]

Previous Thread :: Next Thread 
Clirex is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Clirex
Joined: 22 Jun 2012
Total Posts: 2477
09 Feb 2016 06:35 AM
@mycheeze no
Report Abuse
Clirex is not online. Clirex
Joined: 22 Jun 2012
Total Posts: 2477
09 Feb 2016 05:07 PM
bump
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
09 Feb 2016 05:12 PM
http://forum.roblox.com/Forum/ShowPost.aspx?PostID=183267896
Report Abuse
Clirex is not online. 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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
09 Feb 2016 06:39 PM
No.
The arguments are in the comments at the top.
Report Abuse
Clirex is not online. 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
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