Scripts / Moving Targets

Author
Message
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 16th Jun 2020 19:58
If collision has to be off for an entity to move, how can I get it to detect a hit?
Julian - increasingly disillusioned and jaded
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 16th Jun 2020 21:36
What exactly do you mean by 'detect a hit'?

If you are manually moving stuff around then you will need to do your own collision detection, either by detecting when the entity is with a certain distance of another (or the terrain) or by using ray casting before the movement.

If you want the physics engine to detect the collisions for you then you will have to move the entity using the PushObject command .
Been there, done that, got all the T-Shirts!
PM
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 16th Jun 2020 22:46
Mmm... Feels like I'm getting out of my depth now. I was just using the Move commands with collision off and then briefly turning collision on when the player's weapon is fired. It kind of works but the moving object stops moving for an instant.

What is the easiest way to detect distance between the moving entity and a fired projectile (say, an arrow fired from the bow)? I think ray casting might a bit beyond me at this point.

I appreciate your help, thanks?
Julian - increasingly disillusioned and jaded
PM
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 17th Jun 2020 07:37
The PushObject command is currently 'to be documented'. How does that work?
Julian - increasingly disillusioned and jaded
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 17th Jun 2020 12:03 Edited at: 17th Jun 2020 12:05
Look in the pickuppables script to see how it is used. Also read my physlib thread.
https://forum.game-guru.com/thread/219758#msg2601608
Been there, done that, got all the T-Shirts!
PM
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 17th Jun 2020 17:49
OK. Thanks!
Julian - increasingly disillusioned and jaded
PM

Login to post a reply

Server time is: 2024-04-23 16:58:38
Your offset time is: 2024-04-23 16:58:38