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: using raycasting every 1/30 of a second

Previous Thread :: Next Thread 
ganger800 is not online. ganger800
Joined: 06 Dec 2012
Total Posts: 427
13 Jun 2015 03:44 AM
hi reader :)

like the title says, I plan to use ray-casting every 1/30 of a second (heartbeat)
I want to use this to search targets in front of monsters that are doing 'nothing'
I do this with 1 central place for all monsters, however this still means I need to ray-cast a lot of times
30 times a second * amount of monsters * 3 real look
the real look is what I think I want: 1 directly to the front, and 2 with a little bit of an angle left and right (looking up is not what monsters do, they are nice like that)

is it useful to use ray-casting in this scenario or do you know a better method :)
one thing I can do is pre-scale the heartbeat to 1/5 of a second, however I want to use more than 20 monsters
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Jun 2015 03:45 AM
You don't need to do it 30 times a second, 1/2 of a second should be fine?
Report Abuse
ganger800 is not online. ganger800
Joined: 06 Dec 2012
Total Posts: 427
13 Jun 2015 03:47 AM
yes I can prescale it, however I still want to have a lot of monsters which need to see accurate :)
I don't think the problem will be with 1 or 2 monsters, however when I want 20 - 100 I think it can be a huge problem
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
13 Jun 2015 03:53 AM
Raycasting is an expensive operation and it's recommended you don't use it if you can help it. If you do, make sure you're deciding which monsters need it beforehand
Report Abuse
ganger800 is not online. ganger800
Joined: 06 Dec 2012
Total Posts: 427
13 Jun 2015 03:56 AM
hmm yea I could do that :D
however does someone know a better method to do this? (something that does not require ray-casting)

I also thought about creating a part around the monster and removing the part when the slime starts doing something,
however I don't know if that will work, since I don't want to limit how my monsters can move
Report Abuse
SeanyBiy is not online. SeanyBiy
Joined: 18 Jun 2010
Total Posts: 9407
13 Jun 2015 05:01 AM
Humans can only react to 0.14 of a second, so 1/30th is too much :P
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