Big frame drop when mouse-overing objects

Hello friends.

I’m having this problem I’ve never had and I don’t know how to fix it… I’ve made a simple First Person game, using logic bricks for movement and mouse-look. Basic WASD moves, mouse looks. However, when I “mouse-over”, or just look directly at certain objects in the game I’ve made, the game takes a HUGE FPS drop for as long as I look at the object. As soon as I look away from it, everything returns to normal.

There’s couple of things I suspect are causing this: First is that most of the objects that do this are ones I’ve linked or copied from another scene, although some linked objects behave just fine. Also the ones that drop the fps are of higher polygon count than other objects in the scene. By other objects I mean stuff like a wall, a table, a road, etc. The fps dropping objects are an computer and a TV, both which have multiple polygons that come from ventillation holes to rear panel plugs being modelled.

Has anyone had something similar to this? Is there a way to fix this?

That’s why you gotta use proxy objects. Think about it. if you have a really complex object with lots of vertices and faces, it takes a lot of effort for blender to calculate if the mouse is over the object. If you just use a really low poly proxy of the object you want to mouse over, you won’t lose any frames.

Could you elaborate please? I’m not quite familiar what the proxy object means… And I’m afraid I can’t really lower the polygon count without killing the art style of the game. Nor does it seem to matter; For testing reasons I temporarily deleted 95% of the faces in the object, mousing over the few ones that remained still caused similar fps drop.

Duplicate the object. make it invisible (in the physics panel) use the decimate modifier and decimate it a lot. Make the original object the child of this new one and give the new one the physics of the old one while keeping it invisible. give the decimated object the mouse-over logic. The original object will still be there. it will still look the same.

alternatively you could use a different collision model for it…modeling all the vents etc…is not really a good suit for a game engine.

the proxy just needs to have the general shape so for a TV just use a cube.

Thank you friends for your help! Situation is solved now.

I’ve no doubt the other methods would have worked as well, but for my case, this one seemed to be the best: Select the Television, go to Physics tab, check the Collision Bounds and select Box from the drop-down menu. No FPS drops anymore and everything is running smoothly.

Thanks again!

The title of this thread is a bit misleading regarding the situation you described. Glad you found the cause and fixed it.

i think a raycast is way more efficient then the mouse over brick.

that is exactly what I was referring to when I said ‘change the collision model’. I probably could have worded it better, but glad you got it working.

The mouse over brick does a ray cast measurement.

As monster says, the mouse over brick does a raycast. However, if I remember rightly, every mouse over brick does a raycast, so if you have more than one mouse over brick, a single raycast in python can be faster.