Announcement

Collapse
No announcement yet.

Change collisions in ConstructionScript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Change collisions in ConstructionScript

    Hi all!

    I want to change collision state in depending on blueprint variable. Bu this code doesn't work. Changing a variable "EnablePhysics" in an actor is completely ignored.

    Click image for larger version

Name:	Image_002.png
Views:	373
Size:	74.0 KB
ID:	1692397

    And i don't understand why. By the way, collisions for sphere are full disabled, so they don't affect to this code.
    I hope you can help me understand the error. Thanks in advance!
    [GAME] The Unexpected Quest | [TOOL] Localization UE4

    #2
    mdeni You're using the wrong node, you need SetCollisionEnabled.
    Check out Zof ( puzzle game ) on Steam:

    https://store.steampowered.com/app/1414480/Zof/

    Comment


      #3
      Originally posted by ClockworkOcean View Post
      mdeni You're using the wrong node, you need SetCollisionEnabled.
      This node (SetCollisionEnabled) doesn't work like the first.
      [GAME] The Unexpected Quest | [TOOL] Localization UE4

      Comment


        #4
        mdeni All your doing with the first node is toggling between the box collision ( as you have set it in the details ) and none. That's best done with SetCollisionEnabled.
        Check out Zof ( puzzle game ) on Steam:

        https://store.steampowered.com/app/1414480/Zof/

        Comment


          #5
          Originally posted by ClockworkOcean View Post
          mdeni All your doing with the first node is toggling between the box collision ( as you have set it in the details ) and none. That's best done with SetCollisionEnabled.
          Sorry for my English, it is not my native language. Perhaps I made the wrong point. I mean, that SetCollisionEnabled does not work. As and first variant. Of course I tried it too.
          [GAME] The Unexpected Quest | [TOOL] Localization UE4

          Comment


            #6
            mdeni Yes, maybe we have our wires crossed here. What I mean is


            1) Set the box to block all dynamic in the details

            2) Use the set collision enabled node to run that off and on.
            Check out Zof ( puzzle game ) on Steam:

            https://store.steampowered.com/app/1414480/Zof/

            Comment


              #7
              Originally posted by ClockworkOcean View Post
              mdeni Yes, maybe we have our wires crossed here. What I mean is


              1) Set the box to block all dynamic in the details

              2) Use the set collision enabled node to run that off and on.
              Yep. This is not working.

              Click image for larger version  Name:	Image_001.png Views:	0 Size:	95.7 KB ID:	1692821

              Paste this Actor on any level. And in Details panel try to switch 3-4 times "Enable Physics". After the second switch, the physics stops changing.
              Last edited by mdeni; 11-30-2019, 12:57 PM.
              [GAME] The Unexpected Quest | [TOOL] Localization UE4

              Comment


                #8
                mdeni I mean like this:

                Click image for larger version

Name:	phy.JPG
Views:	375
Size:	83.8 KB
ID:	1692833
                Check out Zof ( puzzle game ) on Steam:

                https://store.steampowered.com/app/1414480/Zof/

                Comment


                  #9
                  Originally posted by ClockworkOcean View Post
                  mdeni I mean like this:

                  Click image for larger version

Name:	phy.JPG
Views:	375
Size:	83.8 KB
ID:	1692833
                  There is no difference in your code and mine.
                  [GAME] The Unexpected Quest | [TOOL] Localization UE4

                  Comment


                    #10
                    mdeni Well, there is. I don't know how well that switch on bool is working.
                    Check out Zof ( puzzle game ) on Steam:

                    https://store.steampowered.com/app/1414480/Zof/

                    Comment


                      #11
                      Well, that was a bug in the engine. Don't forget to vote!
                      https://issues.unrealengine.com/issue/UE-85449
                      [GAME] The Unexpected Quest | [TOOL] Localization UE4

                      Comment


                        #12
                        Was anyone able to find a workaround for this?

                        Comment


                          #13
                          Originally posted by Vallynne View Post
                          Was anyone able to find a workaround for this?
                          I found a workaround. Copy the nodes involving "Set Collision Enabled" from your Construction Script to your Event Graph and wire them up to Begin Play (in your Blueprint).
                          Artstation: https://www.artstation.com/jamesmoore
                          Sketchfab: https://sketchfab.com/James.Moore

                          Comment


                            #14
                            Originally posted by Moore Game Dev View Post

                            I found a workaround. Copy the nodes involving "Set Collision Enabled" from your Construction Script to your Event Graph and wire them up to Begin Play (in your Blueprint).
                            Thank you, yep, ended up doing the same for the time being.

                            Comment

                            Working...
                            X