Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [LOCKED] Help with ObjectRayCast

Author
Message
Olde Worlde Illusions
2
Years of Service
User Offline
Joined: 10th Oct 2021
Location:
Posted: 16th Dec 2021 23:05
I am using the raycasting code to determine if an object already exists at the given location:



When the virtual button is pressed a check is made and if the player hasn't spawned a new defence it is created at that location:





The issue I am having is even when a new defense is spawned it still returns that no object is there. If I increase the distance to .6 then it detects the floor as an object and no defenses can be created. Any ideas, I am totally stumped on this one.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 16th Dec 2021 23:35 Edited at: 17th Dec 2021 00:18
make sure y (or any other coord) can't be "inside" an object or it won't get detected.

this:

...mean's you have a whopping 0.5 world units' worth of a Ray. good luck with that

another thought: you are turning your object(s) collision on via SetObjectCollisionMode(), right?

the ray won't hit it/them, otherwise.

meanwhile, try to use more meaningful thread titles?

i've changed this one so it shows when others search for similar (which we should do before we ask the same questions over and over ).
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 17th Dec 2021 02:14
Please check your original thread where this was discussed, we elaborated this exact issue and I posted a "all-seasons" solution

https://forum.thegamecreators.com/thread/228117#msg2668456
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 17th Dec 2021 09:15
Thread locked.
If you have further questions, then stick with your original thread on the subject.

Login to post a reply

Server time is: 2024-04-24 01:51:03
Your offset time is: 2024-04-24 01:51:03