Trying to attach an item to my actor

GarrowGlitch

  • Posts: 226
I'm contemplating giving up on Stencyl.... I'm running into problem after problem.
My problem is... I'm now trying to run into an object, and when i collide with it, i want to attach it to the player. I don't want to just kill the item then have my player change Animations for every single item i collide with, or i'd have to make hundreds of animations. NOW.....When i collide with this item, i can set the x and y position of it to a certain position of my player, but then when that happens, his "touch floor" behavior goes crazy. I have looked all over for simple attaching, and nothing... Is there anyone who can give me some light on this? Because at this point, i just wanna give up.

LIBERADO

  • *
  • Posts: 2718
Try the following:

In the "Collision" properties  of the item, check the option called "Is a Sensor?".

Tell me the result.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

GarrowGlitch

  • Posts: 226
it just falls through the ground...blahh

LIBERADO

  • *
  • Posts: 2718
it just falls through the ground...blahh
Try also this:

In the "Physics" properties  of the item, select "No" in the option called "Affected by Gravity?".

Tell me the result.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

GarrowGlitch

  • Posts: 226
Getting somewhere.... It attaches, but sometimes when i jump or run into a tile, it detaches...

GarrowGlitch

  • Posts: 226
 it also seems like its continuously colliding. like when i add a sound on collision, it keeps repeating. im eventually gonna want to hit an attack button and have the item change animations. this seems like it may be out of the ballpark for me...  :-\

LIBERADO

  • *
  • Posts: 2718
If you want to be able to perform such tasks, you need to learn to use the Attributes:

http://www.stencyl.com/help/view/attributes/
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

GarrowGlitch

  • Posts: 226
i do kno how to use attributes... i guess im gonna have to drop this idea

LIBERADO

  • *
  • Posts: 2718
In the item, create a boolean Attribute called  "attached" with initial value: "False"

When the item collides with the player, change the value to "True".

Finally, create an Event that continously sets the coordinates of the item to the coordinates of the player when the "attached" Attribute has the value "True".

« Last Edit: June 19, 2014, 04:44:23 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

GarrowGlitch

  • Posts: 226
 
In the item, create a boolean Attribute called  "attached" with initial value: "False"

When the item collides with the player, change the value to "True".

Finally, create an Event that continously sets the coordinates of the item to the coordinates of the player when the "attached" Attribute has the value "True".

Yeah i just cant figure this out. I tried so many options, and the best way is to just make separate animations.... :-[