Slastraf Posted January 25, 2016 Share Posted January 25, 2016 The most annoying script i have worked on. So , yesterday I wanted to make a completely new set up of the rpg camera because my old one was not good. So far everything workED , the player goes to the point where you click . Now it doesnt . I have literally changed nothing, and I am unmotivated because today I was doing nothing, too , because of that. Thats how you set it up: the target of the camera is the player EDIT: remvoed the script because you need to use window:MouseDown(1) if you want to use it with a camera pick. Quote Link to comment Share on other sites More sharing options...
Brutile Posted January 25, 2016 Share Posted January 25, 2016 It could be that you have: function Script:GoToPoint(destination1) self.destination = destination1 System:Print( ">>is moving") end This function has the same name as the one you use for pathfinding. Try changing this to something else. I also noticed that you have a camera pick in the player and the camera script, which look like they are trying to do the same thing (It doesn't seem like an issue, but I though you should know). Quote Link to comment Share on other sites More sharing options...
Slastraf Posted January 26, 2016 Author Share Posted January 26, 2016 It could be that you have: function Script:GoToPoint(destination1) self.destination = destination1 System:Print( ">>is moving") end I also noticed that you have a camera pick in the player and the camera script, which look like they are trying to do the same thing With the one I want to pick an enemy (because its easyer to make it directly from the player) Quote Link to comment Share on other sites More sharing options...
Slastraf Posted January 26, 2016 Author Share Posted January 26, 2016 Still not working. Any other suggestions anyone? Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 26, 2016 Share Posted January 26, 2016 When you debug the game, can you see that the raycast actually sets a new point where the player needs to go? Does the raycast pick at all? Verify which position the raycast picks. Just some ideas. Can't the script right now. Quote Link to comment Share on other sites More sharing options...
Slastraf Posted January 26, 2016 Author Share Posted January 26, 2016 I fixed it . it was the problem that the pick did not trigger because window:MouseDown(1) would be the right thing to use instead of mousehit or what I used. (it did work days ago but not now ?? ) Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 26, 2016 Share Posted January 26, 2016 Something that I always hated with the KeyDown and KeyHit, was that if you use them in multiple scripts, they can give back different results since they could have been used in a different script. I think I had similar problems with mouse Hit as well, but I am not sure. So for instance you have two scripts, both check for the space bar hit. Script 1 says that the spacebar has been hit, but script 2 says it has not been hit. That is because Leadwerks sets a 'hasBeenHit' flag to false once you have requested it in script 1. Quote Link to comment Share on other sites More sharing options...
thehankinator Posted January 26, 2016 Share Posted January 26, 2016 I think it would simplify the problem to combine RPGCamera.lua into RPGPlayer.lua. This way you can have one spot where you do the MouseHit() check. Also RPGCamera.lua calls GoTo() on RPGPlayer.lua, should be GoToPoint(). Quote Link to comment Share on other sites More sharing options...
Slastraf Posted January 26, 2016 Author Share Posted January 26, 2016 GoTo is an function that I implemented inside the rpgplayer I will combine these scripts Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.