- Home /
Question by
Siflou · Feb 19, 2014 at 12:02 PM ·
rigidbody2dontriggerenter2dmassiskinematic
Rigidbody2D isKinematic effect by growing mass to huge number ?
Hey Guys,
I a GameObject that has a Rigidbody2D on it and I want to be able to jump on it without it moves. So first thought I have was like, I'll check isKinematic, but then I realised that my OnTriggerEnter2D wasn't called anymore. So I sort of patched the problem by putting a huge mass on my rigidbody like 10000000, but I don't find this really clean. Does some one has an idea for this ?
Thanks a lot for your time,
Claude
Comment
Record current position of the gameObject before collision and retain current position after collision. Like
Vector2D currentPosition;
void Start()
{
currentPosition = transform.position;
}
void OnTriggerEnter2D(....)
{
.
.
.
transform.position = currentPosition;
}