how to check if my object is on the "floor"?
See original GitHub issueI currently use if(myobj.body.velocity.y == 0)
most time this works except if my object is on top of some object like this:
as you can see in the console the velocity.y
is changed in every frame update even my obj is not moved, I think this can be fixed by setting some parameter for the world?
what caused this problem? and what is the right way to fix? thanks a lot.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
Checking if object is in air or on ground? - Unity Answers
If your ground is tagged "Floor" you should be able to jump no matter if it is a angular surface or not. ......
Read more >How to detect if object is grounded by raycast - YouTube
In this tutorial we discuss what raycasting is, and how to use it to detect whether an object is touching the ground.
Read more >3 Easy Ways to Check if a Floor Is Level - wikiHow
1. Set a 4–8 ft (1.2–2.4 m) carpenter’s level horizontally on the floor. Pick a spot in the middle of the floor or...
Read more >unity - Using collision.contacts to determine if on a floor
Doing this based on contact direction might get tricky, depending on the shape of your player collider. Imagine going up a flight of...
Read more >Using Kinect to detect objects on the floor - Stack Overflow
There is several approaches to find the brightly colored objects. If your sensor will record a static scene, it's possible to use Background ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jcyuan I mean, you can:
type
to your floor, body.type = ‘floor’collisionStart
collisionEnd
collisionActive
What means
tuts
? My game doesn’t have gravity, and I use circles for the heros 😃@fabienjuif ‘tuts’ means tutorials LOL. yepp, I changed my game logic, thanks man~