[SOLVED] ISSUE WITH MY PROJECT NOT GDEVELOP AngleToPosition() deletes object when used in put object around another

Green fist is fine if nothing is done

If i use Player.AngleToPosition(CursorX(),CursorY())
Then X and Y pos of fist return NaN

If i set variable to Player.AngleToPosition(CursorX(),CursorY())
Then put variable in angle in put object around another it works

Davy if you are reading this then following our convo about tinting unable to read Y pos but able to read variable
In this case adding round() does not help

I can’t reproduce the issue. Please try in an empty project. Also, you should log the position after the action, not before because we don’t know what may happens during 1 frame, behaviors for instance.

My bad i should up front check it on different project
I did not create new project just used different one and it works perfectly fine
So its more likely something wrong with my project

BUT i found something interesting

If i go like this with no condition
image

Fist will get deleted and will return NaN
And i did put action to change text below action to put fist around player

BUT if i do this
image
Or this
image

Adding any condition that does not allow this event to run from beginning of scene fixes the issue

Anyway this my project issue not gdevelop bug but i am curious why this happens?

I don’t have any issue doing this:

This is the project in which issue occurs if you care to check it out

But like i said on other project this issue does not occur and i literally copy pasted events between projects

I found cause of the issue

IF 2 is NOT disabled then it will happen
If i disable 2 it will not happen
And problem with 2 is these CamZoomz variable does not exist
Above 1 you see same exact actions with CamZoom and that one exist

I copy pasted this logic from another project LONG time ago
And CamZoom was not declared but everything did work so far so i did not care
Now i declared it and this
DID not delete GooberFist
image

So to test if that was the issue i simply duplicated these actions with CamZoom and changed name of variable in actions to CamZoomz
So it does not exist
And it again deleted GooberFist as soon as i run the game
However again if i would declare this var or use CamZoom which is declared
Or just put there some number instead of variable
it perfectly works

So
image

Change camera zoom was here cause this issue
And im telling you that cause i think it should not happen and maybe it can cause other bugs or whatever
Maybe that is useful info for you

1 Like

So, the issue is setting the camera zoom to 0.

Yes and i think it may be important for you for whatever reason cause it affects stuff at beginning of the scene

Like aside from my initial issue with GooberFist getting deleted when setting it to player angle to cursor without any condition
BUT working perfectly fine if there is any condition

User on discord wanted like falling stars or more like rain i made this

And last event did work perfectly fine
BUT that event with at beginning of the scene did not
(its meant to fake stars already being there when you start game)
Like no stars at all did appear on screen

However declaring that CamZoom variable or to be precise not letting camera zoom be empty value fixed the issue

Thank you for reporting an issue. It should be fixed in the next release.

1 Like