Page 1 of 1

How to check if player is in the way?

PostPosted: Fri Aug 26, 2016 3:50 am
by Danny
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

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

PostPosted: Fri Aug 26, 2016 5:07 am
by JimmySterylian
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.

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

PostPosted: Fri Aug 26, 2016 5:14 am
by Danny
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