Adding a cursorType to the portal

I tried to add a cursor to the portal but not so easy.

The logic in the portal is handle when Ontriggerenter, so adding the IRaycastable to the portal seems quite complecated, at least for me.

The Attack in the Fighter handles the movement to the target if not in range, but nothing in the portal.

Do I have to create a complete method to move the player to the portal position? (in fact when clicking on a pickeableWeapon the player doesn’t move close to it before executing the logic which is in Ontriggerenter also, seems strange for a pickup (but why not) but completly impossible for a portal, the player should not teleport to another scene as soon as he click on a portal from the other side of the level if the portal is in sight).

So, I am quite lost here.

M. D.

1 Like

I don’t think you need any logic other than ‘move to me’. Moving to the portal will cause the player to eventually enter the trigger volume, at which point it will transition.

1 Like

A simple call to

controller.GetComponent<Mover>().StartMoveAction(transform.position, 1.0f);

should do the trick. As @bixarrio notes, once the trigger is hit, the rest of the logic will follow just fine.

1 Like

Privacy & Terms