About Store Forum Documentation Contact



Post Reply 
[Bug] Actor sometime gives null base mesh/actor
Author Message
tipforeveryone Offline
Bronze Supporter

Post: #1
[Bug] Actor sometime gives null base mesh/actor
https://i.gyazo.com/5ff29c74c6a16260b750...2e314b.png

I create some objects with physic box shape to make small debrises fly away when bullet hits obstacles. These debrises can collide with other props and terrain

Here is how I create debris in the middle of the game

Code:
if(bulletHitWall){
ObjectPtr op = UID(...);
DebrisClass* deb = (DebrisClass*)Game.World.createObjNear(*op, Matrix(hitPosition));
deb.Make_It_Fly_Away();
}

DebrisClass is Game.Item

The pointer to the object is ok but sometime when I use REPA(debrisContainer) to do something with it, I get the object's base mesh is null and the game crashes. I have no idea on why this happens. Is object too small to spawn properly with its box shape ?

https://i.gyazo.com/5ad5d6a4d8f502d1850b...6df50f.png

This happens not regularly, but it is about 1% chance or less. most of time the spawned debris fly away ok, but sometime this occured

Scaling up the physic box reduces occurrance rate. It is harder to happen, but still

https://i.gyazo.com/f3f7c3fd57420d61a847...a65230.png

So am I right about too small box shape can make the actor itself become null ?
(This post was last modified: 08-05-2023 10:40 AM by tipforeveryone.)
08-05-2023 10:04 AM
Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Member

Post: #2
RE: [Bug] Actor sometime gives null base mesh/actor
I would always confirms if the ptr is valid, since there is a chance to return null in the logic if the object is not near.
Not sure about the scale question tho that might be more of a physx than engine one
08-05-2023 03:27 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: [Bug] Actor sometime gives null base mesh/actor
You'll have to debug, and you can compile engine in debug mode too, and see what happens.
08-05-2023 03:43 PM
Find all posts by this user Quote this message in a reply
tipforeveryone Offline
Bronze Supporter

Post: #4
RE: [Bug] Actor sometime gives null base mesh/actor
I found the problem.

When I change the physic shape of an object, e.g from convexX to basic shapes or reverse. The "density" value is kept as what it was but the fact it is somehow erased.

I mean if I set the density before changing physicshape, the value of the textbox is kept after changing. but when running in game, that object actor becomes null everytime. Then I set the density again manually (delete the old value and type the same > Enter to confirm). Object's actor/mesh is not null anymore.

It is still a bug I think
(This post was last modified: 08-09-2023 03:26 AM by tipforeveryone.)
08-09-2023 03:24 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: [Bug] Actor sometime gives null base mesh/actor
Please provide step by step instructions how to reproduce the problem.
08-09-2023 04:20 AM
Find all posts by this user Quote this message in a reply
Post Reply