Hey, i have some issues that have been plaguing my mind with problems and i'm after some guidance or understanding
but in unity with dealing with movement, specifically 'transform' and physics
straight off the bat I'm really cautious with using transform as from old game experience, it would simply +/- a value from its position/rotation
(TL:DR, scroll down to bold)
to the naked eye it wont be much noticeable but in some situations it can be unnerving and hopefully it isn't an issue in Unity as it has been in other simple engines
ok, so onto the meat of the subject
using transform to my knowledge forces an object to move to an offset to its position
now, is it actually moving? or is it "teleporting"?
you may notice in some games when a object or item 'teleports' or respawns that there is sometimes a mid position
example would be a player respawning and you for a brief fraction see them flash across your screen
I believe that's simply a side effect of resetting position to a new location, in other words altering the 'transform'
I digress,
The main issue is that if you have a simple physics object and apply a transform which is an override on its position, what stops it from pushing through other objects?
naturally we would use force instead? but is it always the right way to do things?
an issue i tried dealing with was a custom physics and control system for a side scroller game in Unity
using a constant transform to push them down when they are not grounded
and when grounded to stop applying the transform gravity
because of the nature of the game, it felt right to use translate to emulate that old school feel of simple physics
I faced an issue with the trigger when walking between tiles to determine if it was grounded or not
so, i used a character controller which could detect if it was colliding bellow and above which was nice
Unfortunately, applying the character controller stopped my rigid gravity to work
(using transform gravity it didn't detect contact with the ground and kept falling)
I guess what I'm trying to get at is...
is it safe or wise to use transform on objects with physics, is there a risk of the object being pushed through another physical object because of the transform? or should we just use constant force as an alternative?
Edited by DIGI_Byte, 10 April 2013 - 03:12 AM.