Constraining several Positions to Objects
For better understanding and simplicity here's the project file:
https://www.dropbox.com/s/pvc4x3mimf79vd3/Constraining Colliders to Objects.gameproj.zip?dl=0
I tried it with different solutions but none worked.
(I will use the names which I used in the project)
I want to know how to constrain the Position of "Collider for Actor 1" to the "actor 1" but not just one actor 1 and one Collider but 3 (or more) "actor 1" and "Collider". It does work just for one "actor 1" (all "Colliders" will constrain to one "actor's 1" position)
I don't want to make actor 1(1), actor 1(2), actor 1(3) and Collider 1(1) , Collider 1(2), Collider 1(3) when they're really the same (Know what I mean?)
(My ideas: How can I say "Collider" please choose the nearest "actor 1" or use that one with which you are colliding." ?)
For what do I need this?
I have an actor (It's not a rectangle and it's not a circle) and because of that I need 2 invisible Colliders (rectangles) for each object (which is more than just one time in the scene). So I just want to set up where the colliders should be with some rules and the I just throw for example 5xactor1 5xcolliderFront 5xcolliderTop in the same scene and after pressing Preview they will be at the correct place.
Is there a better way for exact collision? No, right?
Answers
When you cannot answer and you're an experienced user please say it. That helps me more than a unanswered question.
Thanks for incoming help!
Why would someone write "I can't answer this"?
I'm really confused by your explanation.
A better approach to asking a question on the forums is to give your actors descriptive names. If I post a question written this way "How can I move Actor 1 towards Actor 3 but have Actor 1 bounce off of Actor 3 without moving Actor 3?", it's much easier to understand if I change it to "How can I move a tennis ball actor towards a racquet actor but have the tennis ball bounce off the racquet without moving the racquet?"
No. What does that sentence mean to you? What are the numbers in parentheses? And what do you mean by "when they're really the same"?
The actor is either a square or a rectangle. There's no other choice. Its collision shape is either a rectangle or a circle. The image is another story. If you don't tell us the shape of the image then we have to guess its shape, which makes helping you more challenging.
What does the "5x" represent here? Have you already gotten this to work? You don't explain how you've tried to do it or if it's actually working.
I don't know! Depends how you've tried to set it up and what's happened when you tried that.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
My guess after looking at your project file is that you're trying to constrain a "hit box" / collision mask actor to each red actor. If so, use the method in my Health Bar Demo: http://forums.gamesalad.com/discussion/comment/384027/#Comment_384027.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
You:
Why would someone write "I can't answer this"?
Me:
When a question keeps being unanswered that says nothing for me, I can just look at the views, right? When more people telling me, they cannot do it, then I know the problem is hard to solve or it's even unsolvable. So then I have to solve it in a complete other way.
You:
I'm really confused by your explanation.
Me:
Yeah, ok I am german so it's hard for me to explain everything clearly enough.
You:
A better approach to asking a question on the forums is to give your actors descriptive names. If I post a question written this way "How can I move Actor 1 towards Actor 3 but have Actor 1 bounce off of Actor 3 without moving Actor 3?", it's much easier to understand if I change it to "How can I move a tennis ball actor towards a racquet actor but have the tennis ball bounce off the racquet without moving the racquet?"
Me:
I understand it's better doing it that way, but I thought first to download the project and then reading my text, that's why I wrote: (I will use the names which I used in the project)
You:
No. What does that sentence mean to you? What are the numbers in parentheses? And what do you mean by "when they're really the same"?
Me:
Yeah that was a try to explain something, let me try it again: I have an actor called actor1 and it's several times in the scene. But cause of my limitation to be just able to constrain one hitbox to one actor1, I have to copy actor1 again and again (not in the scene but under actors) and also my hitbox (named collider) again and again, so I get actor1(1) (I need to rename them) actor (2) and so on. Better?
You:
The actor is either a square or a rectangle. There's no other choice. Its collision shape is either a rectangle or a circle. The image is another story.
Me:
Right, I mentioned that just to let you know that I know about collision shapes.
You:
If you don't tell us the shape of the image then we have to guess its shape, which makes helping you more challenging.
Me:
That was not the point of my question, I think I know which invisible objects I need to choose to make a good hitbox (as less objects as possible). My question was about placing those objects.
You:
What does the "5x" represent here? Have you already gotten this to work? You don't explain how you've tried to do it or if it's actually working.
Me:
That meant that I want to set everything up and then I just put several actor1 in the scene and also several hitbox1 and hitbox2 (both for actor1) and after pressing preview all hitboxes will be at its places (near the actor1's). And yeah that's what I try to reach after this question gets answered.
Me:
Is there a better way for exact collision? No, right?
You:
I don't know! Depends how you've tried to set it up and what's happened when you tried that.
Me:
I think you can answer this now, because I tried so hard to write this text, I cannot really push me a level up in my english skills in just no time.
You:
My guess after looking at your project file is that you're trying to constrain a "hit box" / collision mask actor to each red actor. If so, use the method in my Health Bar Demo: http://forums.gamesalad.com/discussion/comment/384027/#Comment_384027.
Me:
Good guess! Right I want to constrain a hitbox (Put several times in the scene, Named collider in my project. The hitbox contains more than just one object, but I think I know then how to constrain more objects as one hitbox when I know how to constrain one.) to each red actor (several times in the scene, named actor1).
I downloaded that file but the problem is that I cannot really put the actions you made in the projects over to mine. So I wanted to ask you if you can (when you have enough time to do that) modify my project (link first post) to give it the function I want. I would really appreciate that otherwise it's trail and error for me and you can do it with your skills (that's because of reason I know ) in a few seconds maybe minutes.
Why don't you simply duplicate the actor and duplicate the hit boxes . . ?
You mean duplicate them under actor's not after dragging them into the scene right?
Ok let's see how this goes. It's jump and run so I need the platform over and over again. Like 20 times one and 20 times the hitbox (Containing 2 objects.) But that's not the only platform I have 4. So that would make 20x4x2 hitbox actor's and 20x4 actors and for each of them 2 attributes to read out the X Y positions to have them work when I delete them and redrag them into the scene.
Yes.
It's not clear what you are saying, you have something called a 'hitbox' that 'contains' 2 'objects' ?
I don't know what this means, you appear to be calculating the number of actors you need, but then you say something about about deleting and having to 'redrag' them ?
You:
It's not clear what you are saying, you have something called a 'hitbox' that 'contains' 2 'objects' ?
Me:
I need a hitbox (collision mask) but because of the limitation of being able just to use rectangles and circles for the hitbox (otherwise I could use the main object as colliding object obviously) I need more than one object.
You:
I don't know what this means, you appear to be calculating the number of actors you need,
Me:
Right I am calculating:
-I have 4 different platforms x 20 (average number of copies needed in one level) copies (I use the same platform around 20 times in the scene) x 2 actors (for the hitbox) = number of actors which need to be constrained to as a collision shape
-Then I have 4 different platforms x 20 copies (I use the same platform around 20 times in the scene) = number of actor's used as platforms
-Then I have 4 different platforms x 20 copies (I use the same platform around 20 times in the scene) x 2 attributes (Position = game.PositionX and game.PositionY)
You:
but then you say something about about deleting and having to 'redrag' them ?
Me:
Yeah I included that because of the option to select Constrain Attribute (Behavior) 'To:' and then choose Current Scene>Layers> Name of Layer>Name of Actor>Position>X
When you would use that option then all the attributes won't be needed but when you delete the actor's in the scene and put them again into the scene (pointed out as redrag) Gamesalad will come up with an error and the specific constrain informations are gone.
I am thinking now the wrong way with my calculation or am I right?
I think if you could make you questions simpler I think people would find it easier to work out what you are trying to achieve, for example the first line reads . . .
"I have 4 different platforms x 20 (average number of copies needed in one level) copies (I use the same platform around 20 times in the scene) x 2 actors (for the hitbox)"
. . . Could you not simply say:
"I have 4 different platforms x 20 copies - and 2 actors for the hitbox"
. . . . . .
A: What time is it ?
B: OK, I have a watch, it has twelve numbers, each section between the numbers is divided up into minutes, there are 5 minutes between each number, so 12x5 which is 60, so 60 minutes (which is 1 hours), but these 60 divisions also count seconds and there are 60 seconds in a minute (and 60 minutes in an hour), so that would be 60 minutes x 60 seconds x 12 hours . . . .
A: Sorry, but could you just tell me the time !
. . . . . .
I'm still not sure why you are telling me this, do you have a question about the amount of actors ?
What !! Why explain something that you know doesn't work !? Why not just use attributes ?
Sorry I can't be any more help, but like I said earlier if I has to do this I would just place multiple actors into the scene, it's pretty straightforward.
Here's a quick example of what I mean, this only took a few minutes to set up, but it only has a few actors, but setting up 80 or 160 (or whatever it is you need) shouldn't take much longer than a couple of hours.
To respond to your answers above...
Since English is not your first language, I won't push you to communicate more clearly. I don't always know if someone speaks a different language, is very young, or has some other reason for writing in a certain style.
That's not something I can do for free. You're asking on top of the time it took me to respond to your questions, download your project file, test it, and look through the rules, and write another post based on that testing to then spend more of my time updating your file. I'm sorry. If the demo is helpful to you, I'm glad. If not, you might need to spend more time working with GameSalad so that you're comfortable understanding how things fit together. It's a learning curve for sure! It took me about a year to have a strong grasp of how to do things in GameSalad. @Socks and other people here may have other suggestions for how to do what you want.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I didn't realise ! So take my comment above with a pinch of salt.
They might simply be a flamboyant late Victorian period novelist.
I analysed my writing.
It's like:
You: I don't understand
Me: Ok make it more clearly for him to understand ok let's see. Then I make the sentence step for step writing each step down you know. You're like thinking how can I tell him something and you're positioning the words in your head and then when you're ready you write it down and you have simply a better sentence more precise and so on. I could make the sentence as good as yours but that would me take an amount of time it's not worth. So I explain something over and over again. So now let's look this video (huge thank you)
I don't fault anyone for growing up in another country and not speaking/writing English as well as a native speaker. Lord knows my command of German is not, how would I say, gut.
Pictures and photos certainly help!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
After looking your video I don't know really what to think. I see you throwing these rectangles around (with those circles which I think have to overlap to move with the object but I don't know why they are moving with it, just upload the project then I know or make another movie) I could take a look in the rectangle actor where I saw how you can let the other circles read out your position and you showed me the attributes for that (like I do it, throwing around is not needed in my project)
I am sorry but your video told me not more I already knew.
Cause of my limitation of speaking I will make it as short as I can so give me some time and you can give me one precise project to download
So I made a picture to make it as clear as possible.
https://www.dropbox.com/s/rc8nuu9sltceobm/Last hope.png?dl=0
I don't need rotation for my needs.
To end this conversation just make the project as easy as possible explain something with notes when it's needed. (you don't need to do it with many actor's.) I know it's your time but making that project is a hell faster than speaking with an unskilled german who tries to speak english.
When you need money just say it and give your paypal e-mail. (I am serious, I know we will die in the end and everyone cries why didn't we have more time.)
The video was not meant to be a copy of your project, it was just an illustration of how quick and easy it is to constrain multiple 'child' actors to 'parent' actors, ignore the method I am using it is irrelevant, the fact that I was throwing the objects around is also irrelevant, the colours of the actors are irrelevant (etc etc . . . ) the only thing to take from this is that it's quite straightforward to just make a bunch of attributes, and a bunch of actors and constrain them together.
You already know how to constrain actors together ? If so then I'd just get on and start building what you need, it will probably take less time than this thread
I just finished reading and I am like: Noooooo! This cannot be the conclusion of this thread please.
Did you look at my picture?
Is there any better way? (With tables, hell I don't know, can I just say hitbox 1 and 2 constrain to the nearest actor1 or something like that?) I mean look at my calculations (are they wrong? Isn't that just crazy to do?)
In your project (just upload it) the actors seemed to attach to the parent actor but why you just dragged them in I don't understand? But that wouldn't help me anyway in my project right? (Look at the picture)
Yeah right just do it is a good way but not the best.
Your making me crazy. For me it's like when something took much time, there have to be something good at the end.
I am laying in bed waiting for your answer with my socks on. Do you have them still attached to your feet when you sleep, Socks? Why the name? Do you like them, I do!
Ok I got it ... is the answer