How to make my GameObject move on a fixed Platform
I was following a tutorial from AwesomeTuts on Youtube and completed it successfully and then I wanted to convert the game for Android, When I changed the build settings few errors took place here and there but I was able to fix most of them. But now My GameObject doesn't move in the Moving Platform.
Code I Tried,
void OnCollisionStay2D(Collision2D target)
{
if (target.gameObject.tag == "Player")
if (moving_left)
{
target.gameObject.GetComponent<PlayerMovement>().PlatformMove(-10f);
SoundMan.instance.landSound();
Debug.Log("Code Running");
}
if (moving_right)
{
target.gameObject.GetComponent<PlayerMovement>().PlatformMove(10f);
SoundMan.instance.landSound();
Debug.Log("Code Running");
}
}
I used Debug.log and checked in console the code is working but the player stays fixed on the platform, also the Sound runs continuously and not only once.
Help will be appreciated.
Thanks.
Your answer
Follow this Question
Related Questions
Unity2d-Android-C#: How to convert current movement script to be used for touchscreen? 1 Answer
Allocating 2 GB of memory for strings on scene load? 0 Answers
Differences between iPhone and Android development? 0 Answers
Mobile bloom kills performance 1 Answer
How to create a movement script for my person by controlling him by joystick 0 Answers