GetNumCollisions
(Difference between revisions)
Dahnielson (Talk | contribs) |
Dahnielson (Talk | contribs) m |
||
| Line 1: | Line 1: | ||
| + | {{lua-function|getNumCollisions|object}} | ||
| + | |||
Get the number of collisions for an object. | Get the number of collisions for an object. | ||
| − | + | '''Example:''' Numbers of collisions for object will be displayed in maratis console window. | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | Example | + | |
object = getObject("object") | object = getObject("object") | ||
| Line 12: | Line 10: | ||
print(Coll) | print(Coll) | ||
end | end | ||
| + | |||
| + | Check YoFrankie demo for a perfect example, this is used on the FeetBox there. This is one thing you should use to make a character jumping. | ||
[[Category:Lua scripting]] | [[Category:Lua scripting]] | ||
[[Category:Lua function]] | [[Category:Lua function]] | ||
[[Category:Physics]] | [[Category:Physics]] | ||
Revision as of 18:15, 8 February 2014
getNumCollisions(object)
Get the number of collisions for an object.
Example: Numbers of collisions for object will be displayed in maratis console window.
object = getObject("object")
function onSceneUpdate()
Coll = getNumCollisions(object) -- you can rename Coll whatever you want
print(Coll)
end
Check YoFrankie demo for a perfect example, this is used on the FeetBox there. This is one thing you should use to make a character jumping.