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.

Newcomers AppGameKit Corner / ObjectRayCas) on scaled objects for collisions

Author
Message
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 1st Oct 2017 00:44 Edited at: 1st Oct 2017 00:53
Like the title says, I am using ObjectRayCast() for 3D object collisions, and had trouble detecting hits on the animated objects.

At first I thought the scaling was the problem, but discovered that when I changed from LoadObjectWithChildren( ) to LoadObject( ) the detection worked fine.

This is fine for my project, because only the player's object really needs to be animated, and the method I am using to RayCast works fine to detect the collisions with other objects.

Has anyone else had any problems with RayCasting on scaled objects with children?

Or, is there an easy way to get it to work properly that I am missing?


I am currently using the basic method as described in the manual and one of its its examples.

I did a search on the forums here, but the old threads said that future updates would allow for this and they were locked.

Thanks in advance for any insight on a work around or current command limitations.

CE


EDIT

Sorry I did not catch that typo in the title.... ObjectRayCas) should have read ObjectRayCast()

Maybe a MOD can fix that for me please? THANKS!

And NO, I am not new to AppGameKit, and I thought I was posting this in Chat ... I will try to take my time and pay better attention when posting in the future.

lol ... I am new to RayCasting for the 3d objects though

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 1st Oct 2017 16:30
When you set the object scale, do you use SetObjectScale??

Quote: "Note that this will not work correctly with bone animated objects, use SetObjectScalePermanent instead. "


Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 1st Oct 2017 21:01
I was/am using SetObjectScalePermanent()

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 1st Oct 2017 23:23 Edited at: 1st Oct 2017 23:25
According to the thread below raycast does not work properly with loadobjectswithchildren() - I use an invisible box that follows my animated objects.

It also does not work properly on scaled objects - it only detects the original size. If you scale a 2x2 plane to 8x8 it will not detect outsides that 2x2 plane. I haven't tried setobjectscalepermanent(). I may try that later

https://forum.thegamecreators.com/thread/216295
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 2nd Oct 2017 15:57 Edited at: 2nd Oct 2017 16:12
Thanks for the replies guys!

I am already using the invisible boxes as a work around too!

Only, I have 6 of them for my player's object to make a better shape than a simple box.

One in front, one in back, and two on each side so I can make a somewhat curved line.

It works, but it is a little complex though, hence my asking for help to discover a better way.

That thread is old, and there have been many updates, which in another thread I saw Paul saying he would address it in the next update and there have been a lot of updates since then.

It is probably working okay now, because I discovered yesterday that my installation was bad.

I had not uninstalled before installing an update, so the compiler was the wrong one.

I have fixed my installation now, but haven't re-tested the raycasting on the scaled animated objects since the work around is already complete.

I will experiment with it if I started getting any frame rate drops.

Anyway, if anyone else has issues then maybe this will help knowing to ensure the installation is correct, and knowing the invisible boxes for a work around.

Thanks again guys!

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1

Login to post a reply

Server time is: 2024-04-20 11:04:37
Your offset time is: 2024-04-20 11:04:37