You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Solved: Never mind. I just flicked back to the documentation after writing this, and there it is - setUserData !!
Hi
I've started implementing this library into a 3D engine, but I am unsure how to associate a game object and a collision body together.
Say I have 10 bad guys, with a unique index each. When detecting a collision between the player and a collision body - how do I know which Bad Guy was involved in the collision. With Chipmunk2D for example, you can use your own data structure when creating a physics object - then in the collision function, you can look up the data structure and there is your ID for who is involved in the collision.
Is that what the Entity system is for? If so, I am unsure how to use it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Solved: Never mind. I just flicked back to the documentation after writing this, and there it is - setUserData !!
Hi
I've started implementing this library into a 3D engine, but I am unsure how to associate a game object and a collision body together.
Say I have 10 bad guys, with a unique index each. When detecting a collision between the player and a collision body - how do I know which Bad Guy was involved in the collision. With Chipmunk2D for example, you can use your own data structure when creating a physics object - then in the collision function, you can look up the data structure and there is your ID for who is involved in the collision.
Is that what the Entity system is for? If so, I am unsure how to use it.
Any pointers would be great.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions