How do I make my object spawn on a specific spot?

Get help using Construct 2

Post » Tue Mar 18, 2014 6:06 pm

Hey!

Image
On the left you can see a frame of my character running, and a frame of my character slashing his sword (note how he doesn't have legs). What I want to do is that when the player presses the J button while running, the legless sword slashing sprite would spawn on top of the running one. I pretty much got it all worked out, except for making the sprite spawn where I want it to. I tested my game, and it spawns right on top of the character's legs: Image.

Anyone kind enough to explain how to make the sprite spawn so it would all look like this?:
Image
B
6
S
1
Posts: 22
Reputation: 600

Post » Tue Mar 18, 2014 6:35 pm

I think you should create a new Imagepoint on the 'Running' sprite, setting the new Imagepoint on the position where you want to spawn the 'Slashing' sprite.

And in the event, which you are spawning the 'slashing' sprite, set the position of 'slashing' spawning as the position of the Imagepoint you created in the 'Running' sprite.

I think the solution is something like that. Please, someone correct me if I'm wrong.
Last edited by milk on Tue Mar 18, 2014 10:12 pm, edited 1 time in total.
B
3
Posts: 9
Reputation: 218

Post » Tue Mar 18, 2014 6:40 pm

Yes, that's exactly what I did before posting this. I thought it would work, but it doesn't for some reason, it just spawns on the legs :c
B
6
S
1
Posts: 22
Reputation: 600

Post » Tue Mar 18, 2014 8:00 pm

milk already gave you the solution.
You need to setup an ImagePoint on the running sprite where you want the splash to be positioned. Also remember to check the origin point of the slashing sprite, these points will overlap when you create the sprite.
Post a capx if you're still having trouble
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Thu Mar 20, 2014 4:22 pm

caiorosisca wrote:milk already gave you the solution.
You need to setup an ImagePoint on the running sprite where you want the splash to be positioned. Also remember to check the origin point of the slashing sprite, these points will overlap when you create the sprite.
Post a capx if you're still having trouble

That's so weird, I must be doing something wrong.. I hope no one minds walking me by my hand on this...

1. I make an image point, called Sword, and then place it on the belt buckle of all the "running" sprite frames
2. I set the "Slashing" sprite's origin on the belt buckle as well. Then I give the sprite a "Pin" behaviour.
3. I set that the "Slashing" sprite would spawn at the image point "Sword" whenever the player is running and attacking at the same time. (I also make the 'slashing" sprite pin to the "running" sprite.
4. I play test it. In theory it should work, but nope, the "slashing" sprite spawns on the "running" sprite legs.

Image
B
6
S
1
Posts: 22
Reputation: 600

Post » Thu Mar 20, 2014 6:43 pm

It looks right, try double checking if the image point is at the right place in every single frame, on all animations, and both sprites.
Another test you can make, remove the pin behaviour from the slashing sprite and add a Evert tick event and set Slashing sprite's position to another object (PlayerBox/running animation) at image point("Sword").
Try uploading a capx, makes it alot easier to find what's wrong, it doesn't need to have the whole project, just the part that isn't working.
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643


Return to How do I....?

Who is online

Users browsing this forum: marcinkowski, plinkie, zenox98 and 25 guests