Nope that is right becuase if you used integers they don't hold decimals and that would cause the pixel offset. As movement happens over hundredths of a pixel and you need those positions. So that is correct. Make sure you actors that make the edges spawn above the platform as code fires in the layers from bottom to top. So you want the position of the platform to update before the sides get that info. Try that.
@Lost_Oasis_Games said:
Nope that is right becuase if you used integers they don't hold decimals and that would cause the pixel offset. As movement happens over hundredths of a pixel and you need those positions. So that is correct. Make sure you actors that make the edges spawn above the platform as code fires in the layers from bottom to top. So you want the position of the platform to update before the sides get that info. Try that.
I think I already got it in the right order?
Check pic please
@Lost_Oasis_Games said:
Do you have any bounce set on those actors? Increase the density of your player actor.
Bounce is set to 0 on both player and platform as in the tutorial & density to 100. In the tutorial it works fine but not for me ;/.
@tatiang said:
Does this happen when the platform is not moving? In other words, if the platform is still, do the edges not line up?
What behavior are you using to move the platforms (Move, Accelerate, Constrain Attribute, etc.)?
If I have the platform still the edges are on place. The movement is set as in the platform tutorial. Check picture,
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 11,949
My guess is that Interpolate and Constrain are working at different speeds. I know that's not very helpful but it does point to the cause. I wonder if the same thing would happen if you moved the platform using a Move/Move To behavior or a Change Attribute self.Position.Y behavior wrapped in a timer.
@tatiang said:
My guess is that Interpolate and Constrain are working at different speeds. I know that's not very helpful but it does point to the cause. I wonder if the same thing would happen if you moved the platform using a Move/Move To behavior or a Change Attribute self.Position.Y behavior wrapped in a timer.
I tried that but the elevator wont move.
How should I write my exicting code?
I removed the intepolate and added the
timer for "self.myspeed"
change attribute self position.y to self.MyMin
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 11,949
If you use a Timer, you'd need to change attribute self.Position.Y to self.Position.Y+10 or some other small number. But if you want it to stop at a specific point, you'd probably want to use Move To instead.
@tatiang said:
If you use a Timer, you'd need to change attribute self.Position.Y to self.Position.Y+10 or some other small number. But if you want it to stop at a specific point, you'd probably want to use Move To instead.
wont work man, Im getting crazy about this dammit haha
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 11,949
edited January 2016
No, it won't work. You have a rule that says if the Y position is greater than or equal to MyMax move to MyMin and when the Y position is less than or equal to MyMax move to MyMax. But if that actor is at or above MyMax and starts to move down, as soon as that actor crosses the point where MyMax is, the "Move Up" rule triggers and the actor moves up again.
I think you meant to have ≤ self.MyMin as the rule condition in the "Move Up" rule. And maybe relative to scene instead of relative to actor? I'm not sure how you intend for it to work but the lower and upper bounds either need to be positive and negative relative to the actor or they need to be set positions relative to the scene.
@tatiang said:
No, it won't work. You have a rule that says if the Y position is greater than or equal to MyMax move to MyMin and when the Y position is less than or equal to MyMax move to MyMax. But if that actor is at or above MyMax and starts to move down, as soon as that actor crosses the point where MyMax is, the "Move Up" rule triggers and the actor moves up again.
I think you meant to have ≤ self.MyMin as the rule condition in the "Move Up" rule. And maybe relative to scene instead of relative to actor? I'm not sure how you intend for it to work but the lower and upper bounds either need to be positive and negative relative to the actor or they need to be set positions relative to the scene.
I got 2 self attributes on the vElevator.
MyMax & MyMin.
If i set the rules ------------------
Rule
if attribute self.position.y >= self.MyMax
DO
Move to
self.MyMin relative to scene.
&
Rule
if attribute self.position.y <= self.MyMin
Move to
self.MyMax relative to scene.
it should work right?
Lets say the value of MyMin is 10 and MyMax is 1000
Then the actor should move between y10 to y1000?
Check the picture, It should be correct now.. Or Am I damn lost in space?
Getting pritty enoying now with this elevator thing, frustrating little issue that prolly is more simple...
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 11,949
I even made this kind of elevator but then the issue is that when my player stands on the elevator he + the elevator fall down towards the bottom of the screen.
Okey, I managed to get the elevator + edges move correctly up and down between 2 points... Issue now is that when my player jump on top of the elevator it falls down towards the bottom of the screen. I got the "movable" attribute checked else the elevator is stuck. What to do?
Players Density is 100. But that does not change the fact that the elevator falls when he is jumping ontop of it. @tatiang@jamie_c
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 11,949
edited January 2016
Okey, I managed to get the elevator + edges move correctly up and down between 2 points.
Hooray! So no more misaligned edges? That's great. On to bigger problems...
Have you tried adjusting the density on the elevator/platform actor?
Comments
Yes I do, is that wrong?
Nope that is right becuase if you used integers they don't hold decimals and that would cause the pixel offset. As movement happens over hundredths of a pixel and you need those positions. So that is correct. Make sure you actors that make the edges spawn above the platform as code fires in the layers from bottom to top. So you want the position of the platform to update before the sides get that info. Try that.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
I think I already got it in the right order?
Check pic please
if you mean that the Vertical platform should be below the Edge actor in the actor list then I already tried that. Still same issue!
Show me the code in your edge actor.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
One more issue is that my player "bounces" on the platform while its moving down.
I dont know why.
Here is pictures of the code :
This is how it looks when my hero "bounces" when the platform is on the way down.
Do you have any bounce set on those actors? Increase the density of your player actor.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Does this happen when the platform is not moving? In other words, if the platform is still, do the edges not line up?
What behavior are you using to move the platforms (Move, Accelerate, Constrain Attribute, etc.)?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Bounce is set to 0 on both player and platform as in the tutorial & density to 100. In the tutorial it works fine but not for me ;/.
If I have the platform still the edges are on place. The movement is set as in the platform tutorial. Check picture,
My guess is that Interpolate and Constrain are working at different speeds. I know that's not very helpful but it does point to the cause. I wonder if the same thing would happen if you moved the platform using a Move/Move To behavior or a Change Attribute self.Position.Y behavior wrapped in a timer.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I tried that but the elevator wont move.
How should I write my exicting code?
I removed the intepolate and added the
timer for "self.myspeed"
change attribute self position.y to self.MyMin
If you use a Timer, you'd need to change attribute self.Position.Y to self.Position.Y+10 or some other small number. But if you want it to stop at a specific point, you'd probably want to use Move To instead.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
wont work man, Im getting crazy about this dammit haha
No, it won't work. You have a rule that says if the Y position is greater than or equal to MyMax move to MyMin and when the Y position is less than or equal to MyMax move to MyMax. But if that actor is at or above MyMax and starts to move down, as soon as that actor crosses the point where MyMax is, the "Move Up" rule triggers and the actor moves up again.
I think you meant to have ≤ self.MyMin as the rule condition in the "Move Up" rule. And maybe relative to scene instead of relative to actor? I'm not sure how you intend for it to work but the lower and upper bounds either need to be positive and negative relative to the actor or they need to be set positions relative to the scene.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I got 2 self attributes on the vElevator.
MyMax & MyMin.
If i set the rules ------------------
Rule
if attribute self.position.y >= self.MyMax
DO
Move to
self.MyMin relative to scene.
&
Rule
if attribute self.position.y <= self.MyMin
Move to
self.MyMax relative to scene.
it should work right?
Lets say the value of MyMin is 10 and MyMax is 1000
Then the actor should move between y10 to y1000?
Check the picture, It should be correct now.. Or Am I damn lost in space?
Getting pritty enoying now with this elevator thing, frustrating little issue that prolly is more simple...
That looks correct. Does it work?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
No its not working this way
I even made this kind of elevator but then the issue is that when my player stands on the elevator he + the elevator fall down towards the bottom of the screen.
I wish platforms were my specialty but I'm just making guesses here. Someone like @jamie_c might have an idea.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@jamie_c - What is your input of this issue? I used 2 different tutorials as source and it wont work
Okey, I managed to get the elevator + edges move correctly up and down between 2 points... Issue now is that when my player jump on top of the elevator it falls down towards the bottom of the screen. I got the "movable" attribute checked else the elevator is stuck. What to do?
Players Density is 100. But that does not change the fact that the elevator falls when he is jumping ontop of it.
@tatiang @jamie_c
Hooray! So no more misaligned edges? That's great. On to bigger problems...
Have you tried adjusting the density on the elevator/platform actor?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I added 999999 density to the platform and now it works!!!
Edges is correct, the platform works up and down and the player stays on it.
OMFG finally HAHA! Thank you for being patient with this issue!!!!
@tatiang This releef is damn better than drugs man! hahaha woaw Im glad now
Lol! You're welcome!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
You should watch my physics series. It covers the basics like density and friction and such. Good stuff to know.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@KIIVIIN, sorry. I wasn't online last night to see your request, glad you got it worked out though!
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page