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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|