Player Touch Event Touch
Yanfly Engine Plugins is a plugin library made for RPG Maker MV, a wonderful piece of software to help you make that role playing game of your dreams. You can find out more about RPG Maker MV.You can grab the plugin here:For those who have on-screen encounters, you may have discovered that making touch encounters in RPG Maker MV to be rather difficult when it comes to performing a sneak attack upon an event or such. This plugin makes the event encounter checking process easier by providing six conditional script calls for you to utilize when checking event vs player positions.IntroductionFor those who have on-screen encounters, you may have discovered that making touch encounters in RPG Maker MV to be rather difficult when it comes to performing a sneak attack upon an event or such.
Hi guys, I am trying to move player at screen touch event direction, and actually i got it some far, here are few lines.local function movebox(event)Player:setLinearVelocity( event.x - Player.x, event.y - Player.y )print('move box')endRuntime:addEventListener('tap', movebox)With this i am able to move player in touched direction, the only problem is speed.For eg. If i tap on the screen 100 pixels away from players position players will move at the speed of say 100. And if i touched screen 200 pixels away from player then player will move at the speed of 200. Like it seems like player start moving faster at longer distance.What i want to do is i want to keep the speed amount constant.Thanks in advance.
Event Touch Vs Player Touch
Hey.Here is some code I am using to move a player in a given direction. I believe it was initially posted by Graham Ransom in response to another post, so I hope he doesn't mind my reposting it here. (thanks Graham!)The problem with your code is that when you are setting the velocity, you're only feeding in a direction, and not the speed to move. The code below works, but you should note that my character rotates around, and the angle of rotation is used to calculate the direction of motion.vel = 100 - this is the arbitrary speed of player motion.p1Rads = player1.rotation. math.pi / 180local velX = math.cos (p1Rads). vellocal velY = math.sin (p1Rads).
Input.GetTouch returns Touch for a selected screen touch (for example, from a finger or stylus). Touch describes the screen touch. The index argument selects the screen touch. Input.touchCount provides the current number of screen touches. If Input.touchCount is greater than zero, the GetTouch index sets which screen touch to check. Event Notetag: – This will cause the event to not immediately face the player when approached making it possible for the game to check the direction each is facing. – This will allow the event to trigger if the event touches a follower and not just the main player.
Mobile Touch Events
velplayer1:setLinearVelocity(velX,velY).