|
Post by DarkTonic Dev on Nov 13, 2015 1:21:00 GMT
Ok. I can't think of a way for you to not lose your changes when you update. Sorry
Although you may want to try modifying the Isgravity property code instead
|
|
grahamh
New Member
Posts: 4
Posts: 4
|
Post by grahamh on Nov 18, 2015 16:42:05 GMT
Ah, programming is like life - it's all a learning process!
I had to take a step back and wonder why no one else had wanted to counteract the effect of gravity on projectiles in their own games.
Dark Tonic Game Kit requires gravity to be enabled on a rigidbody in order to reset rotation and velocity when a prefab is respawned (a projectile is fired a second and subsequent time, for example).
But then, my projectile was supposed to be a laser pulse - I didn't want it affected by gravity. So, Game Kit wants gravity on in order to work correctly, and that meant my laser projectile thingy was going to fall off with distance.
Somehow, I managed to convince myself that the only solution was to rewrite a small piece of the Game Kit code in order for me to have my laser projectile working with the Game Kit and yet not be forced to have gravity enabled on its rigidbody.
Of course, that meant that when Core Game Kit was updated, the altered code would get overwritten.
The solution was embarrasingly simple really. Just apply force to the projectile to counteract the force of gravity. That way, gravity can be enabled on the projectile's rigidbody, and Core Game Kit doesn't need to be rewritten. I guess I don't have to worry about updates to the code either then.
I guess it all comes down to a lack of experience (or knowledge).
Hence the update to this post in case anyone else has missed the obvious.
|
|
|
Post by DarkTonic Dev on Nov 18, 2015 20:04:05 GMT
Glad you found an acceptable solution
|
|