question

Maryam H2 avatar image
0 Likes"
Maryam H2 asked Maryam H2 commented

Companion Visualization

Hi there,

When using this code below:

  1. patient.Companions.clone().push(patient)

to let companions walk with patients, how we can avoid the visual problem so companions and patients are not standing on top of each other.

1649364658699.png

thanks

FlexSim 22.1.0
visualwalkstand
1649364658699.png (16.8 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Ryan Clark avatar image
0 Likes"
Ryan Clark answered Maryam H2 commented

Hi @Maryam H2,

You can set the location of the Companion using Companion.location (FlexScript Class - Object (flexsim.com)). You can set the location vector to be equal to the current location plus some offset, and that should place the companion next to the patient instead of the same location as the patient.

I hope this helps! Let us know if you have further questions!

· 5
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.