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 Studio Chat / [SOLVED] Normal Rotation

Author
Message
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 25th Apr 2019 13:21
Hello Forum,

Is there any possibility to make the objects that are positioning to raycast position, to rotate them depending on the normals? Here is the problem:


Here is my code:



Thank you very much!
www.alexmatei.com

The author of this post has marked a post as an answer.

Go to answer

smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 25th Apr 2019 14:25
This post has been marked by the post author as the answer.
yes this example has what you need
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 25th Apr 2019 15:48
Thank you very much!
www.alexmatei.com
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 26th Apr 2019 18:10
One more thing: How can I disable the possibility of detecting any raycast function to a character controller object? I tried setobjectcollisionmode( objnum, 0 ), but has no effect.

Thank you!
www.alexmatei.com
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 26th Apr 2019 18:55
if you can't turn off the collision for the character controller (not tried, just assuming you are correct) then you could ignore that result and keep checking if the returned value as GetObjectRayCastHitID( index ) uses an index - assuming index 0 would return the character controller id, index 1 would return the object hit after that etc
You can check the number of valid indices with GetObjectRayCastNumHits()
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 27th Apr 2019 07:49
Like:

blltobjht = GetObjectRayCastHitID(0)

if blltobjht = 12 = 0 and blltobjht < 100
//code
endif

12 is the character object

It truly works, but when the bullet is colliding with the player, it does not go through it, like setobjectcollisionmode does. Maybe setobjectcollisionmode on character controller is a bug?
www.alexmatei.com
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 27th Apr 2019 17:07 Edited at: 27th Apr 2019 17:08
ah yh it doesn't keep checking once a collision is found, thought it did, sorry.
but you can use a specific object and keep checking from the contact point to the desired end point (i.e. until it hits the desired object) though that requires you to turn off the collision of any object in the way i think - like so


p.s. i'm not sure how the character controller interacts with the world scale but for the example above it doesn't appear to have any impact on the ray cast?
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu

Login to post a reply

Server time is: 2024-03-29 04:40:38
Your offset time is: 2024-03-29 04:40:38