GetNumCollisions
From MaratisWiki
(Difference between revisions)
(Created page with "Get the number of collisions for an object. Check YoFrankie demo for a perfect example, this is used on the FeetBox there. This is one thing you should use to make a charact...") |
Dahnielson (Talk | contribs) m |
||
| (3 intermediate revisions by one user not shown) | |||
| Line 1: | Line 1: | ||
| + | {{lua-function|getNumCollisions|object}} | ||
| + | |||
Get the number of collisions for an object. | Get the number of collisions for an object. | ||
| − | + | {{lua-function-param|object|object to operate on}} | |
| − | + | '''Example:''' Numbers of collisions for object will be displayed in maratis console window. | |
| − | + | ||
| − | Example | + | |
object = getObject("object") | object = getObject("object") | ||
| Line 12: | Line 12: | ||
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 function]] | ||
| + | [[Category:Physics]] | ||
Latest revision as of 00:27, 9 February 2014
getNumCollisions(object)
Get the number of collisions for an object.
-
object: object to operate on
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.