Hi,
I’m rewriting one of my game to use Physics 2.0.
In the game, players and ball are inside a circular field.
I can bounce players back towards the center when they try to get out, but how can I handle the ball bounces?
In my first version, I used Ball.ForceAngle() to know which way it was coming from, and then, with some maths wizardry, I would get the bounce angle.
With Physics 2.0, ForceAngle remains at 0, it seems.
I tried to do an outer obstacle but the collision masks don’t allow a “cutout” circle.
Here’s the field:
Well, not really, I think we need more customization on the collision masks.
I placed an invisible Center object and checked the distance of objects from that Center point to trigger the bounces.
But yesterday, I made changes to the game, and I placed small walls all around the circle. It took me 36 walls (10 degrees each)… about 10 minutes, I guess.
Hi @ouais25 please don’t bump a 5 year old thread.
You can create a new topic with your question and add context to what you’re trying to do exactly and what’s the issue you’re facing. I’m pretty sure you’ll get an answer there.
Gruk’s issue comes from the fact he try to check force of ball
While he is using physics (meaning he is not using forces)
Kinda like you keep your house warm by having hot water in metal pipes running around your house
And then you try to check how much you spent last year on wood for fire place
Well you are not using fire place you are not using wood so there is nothing to check
I am not good with physics
BUT i bet there is expression or a way to check angle of movement with physics
And you would use exactly that
To bounce off wall like straight flat wall it would be angle of movement -180
For a circular shape of a wall
I believe it be either the same
OR angle of movement and here some math magic with angle of wall + / - and then -180
Or something like that
I am not good with equation so i can’t assist you any further
About necroing old topics
@insein This is only forum i am using on regular basis
But sometimes i do google some crap and i find posts on other forums
And you know what i see?
How either
A - someone did necro a post and then someone else comes and say (do not necro old posts and make new one)
B - someone makes new topic and someone else comes and say (was asked 1000000000 times use search feature)
C - kinda mix between A and B but ends up worse for user rather than just written advice
So i care to ask you few questions here
Since you are guiding other user here i believe you will have no problem answering them
And i wanna answer from you not a moderator or any other user
Since seems you are expert here on the topic
(i mean others can try to answer but i will believe only your words)
Mainly for me to know but also for ouais25 and any other potential user here
1 - Why posts are not automatically locked after some period if inactivity if we should not necro them?
2 - Why we have ability to to reply to old posts if we should not?
3 - What is expiration date for a topic? How long it can be inactive until no one should try to reply to it?
4 - In previous question (#3) does same time period apply to asking question in said topic same as in answering questions in said topic?
5 - Do you wish for me and other users including you to google how to do something in gdevelop
And find 20+ separate topics about same thing with 3-5 replies not solving the problem and creating another topic so any next user also adds new topic so there are more topics to find with no answer?
6 - Should i make new topic to ask these questions i just ask you or is it ok to use same topic? Even so original topic is 5 years old?
You may find my questions as a joke and well you will be right
But if you did write to me such message i would be dead serious with these questions and i would expect serious answers
So if not for me i hope you will answer them for any potential future user so they know what to do
And don’t take it as attack on yourself
At this point i am really curious what you have to say
I’ll let you continue about solving this bouncing problem.
I edited the previous post to put a spoiler tag on the “necroing old topics discussion” , if you have any question about necroing old topics please, open a new topic, or awaken an ancient.
It’s okay to anwser to a post years later when:
Click to see the reasons
If another user has exactly the same problem, it’s ok to ask for news.
If the problem is still applicable in the current version of GDevelop.
(I mean if for example the question was about managing C++ code in a code block when this is not possible in GDevelop 5 then it wouldn’t have been relevant to reopen the topic.)
If reopening a topic can help find a solution and close the topic because it’s resolved, I’m all for it.
Opening a new discussion with the same question is fine too, but it does duplicate searches, so I understand reopening a discussion in a previous topic.
I don’t think there’s a solution yet using the physics collision masks, because you can only add 1 custom mask and it can’t be a concave shape like the hollowed out circle.
This workaround can work.
If you’re working with a circle like in Gruk’s case, you can do it dynamically by using a repeat action to create the walls. Just make sure the origin point of the wall is at the center.
I told you
Don’t take it as attack on yourself
And as much as i stated questions were a joke
I really am curious about what you have to say
Not to humiliate you
But aside from Luni asking ppl to use search function before making feature request when someone (including me) made feature request that more or less already existed
I never seen any1 instructing others to don’t necro
Where it was always my personal fight about old posts
Do i necor and have someone lecture me
Or do i make new topic about it and let someone cry cause even so i did use search function or find similar or exact same topic i did make new one
And i simply wonder how other ppl view it hence my questions
And i think its good you or someone else who is not moderator instruct other ppl what to do or not
Cause we kinda all use this forum so we kinda all should take responsibility for it
I on other hand follow simple logic
I see something is not blocked from being used (e.g topic is not locked) i will reply in it
If i do something wrong i will be told it is not ok
Yet i really am waiting for your take on this if you care
I know this workaround.
But I was wondering if in the meantime, a clean solution or a relevant extension would help with this.
I understand from the anwsers that there is no clean solution.
I will probably try solution from ZeroX4, based on maths. I bet ChatGPT will provide me with the maths
But, it’s a bit a pain to do that this way