How to check if player is in the way?

Have any questions or problems in making your game, subscribing and/or using our software? Post here.
Forum rules
Make sure you are using the newest version. This can be downloaded at the top of the site via the "downloads" link.

Use a very good subject. "Problem" or "Help" are unacceptable titles.

Use the search feature before posting a question, as the answer is probably already here.

Subscript out of range error 9: This is a generic error, and we'll need way more information than that to figure out the problem. If you get this, strongly consider following the instructions of submitting your project through the Submit Bug feature within the editor.
User avatar
Danny
001 Forum Master
 
Joined: Tue Jul 12, 2011 7:14 am

How to check if player is in the way?

Postby Danny » Fri Aug 26, 2016 3:50 am

I want to place a tileset using the mouse and so far it's working fine except one little issue. How do i stop it placing tilesets if the player is in the way? It's allowing me to place tiles when the player is in the way, causing the player to get stuck obviously lol.

Ideas? I tried using line branchs etc but they check if the main actor is already colliding with a solid, i want it so it checks if the player is in the way when trying to place.

Thanks. :D

User avatar
JimmySterylian
001 Fanatic
 
Joined: Tue Jul 29, 2014 2:28 pm
Location:  ­ 

Re: How to check if player is in the way?

Postby JimmySterylian » Fri Aug 26, 2016 5:07 am

In what way exactly do you want it to check if the player will be obstructed? Your best bet would be having a comparison branch checking if the X and Y coordinates you are trying to place an object is close or equal to the player's position.
Image

User avatar
Danny
001 Forum Master
 
Joined: Tue Jul 12, 2011 7:14 am

Re: How to check if player is in the way?

Postby Danny » Fri Aug 26, 2016 5:14 am

Still not working, i used this;

Geometry.Distance(Cursor.TargetZofY(0),32,Cursor.TargetZofY(0),Actor("main").X,Actor("main").Y,Actor("main").Z)

With the value being 32.

I'm new to all this.


Edit: Error in my scripting. My bad. Thank you! :D
Last edited by Danny on Fri Aug 26, 2016 5:22 am, edited 1 time in total.
Reason: Automatically merged double post.


Return to Technical Support Questions

Who is online

Users browsing this forum: No registered users

cron