Can a raycast detect a clone?

Started by Pfaber11, April 22, 2021, 18:20:04

Previous topic - Next topic

Pfaber11

Good evening . was wanting to know can a raycast between an object clone and an object detect a hit . If not I have a lot of work to do planting trees.
The reason is I have made 1000 tree clones and I need to know when I run into one of them . 
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

blinkok

Yes. That should work. Not sure about an instance though

MikeHart

From my AGK days I can confirm that it does.

Pfaber11

HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

RemiD

to make your procedure faster :
-use a distance check before doing the raycast check...

Pfaber11

HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

RemiD

if you are trying to position trees on a terrain (with reliefs), there should be a command to get the terrain height (or Y) at X,Z...


Pfaber11

I came up with another solution of how to do it and it works very well instead of cloning I have a small piece of code that makes and plants my trees randomly as  objects rather than clones and for checking hits I did something something very similar . Saved myself writing 1000's of lines of code . All working very well too. As for clones I had no luck in detecting hits when I run into the trees but the way I'm making the tree objects is just as fast and the hit detection works a treat.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

blinkok

If you use instances it only has one copy of the mesh

Pfaber11

Thanks for all the replies I've now got a road going through the forest so far not too shabby. I'm 11 days into this project and have learnt a few new things . Have an excellent day.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Amon

Quote from: Pfaber11 on April 25, 2021, 13:34:46
Thanks for all the replies I've now got a road going through the forest so far not too shabby. I'm 11 days into this project and have learnt a few new things . Have an excellent day.
I love stuff like this. Keep going. Keep improving. Keep learning. Achieve even greater. Have an excellent day too, m8!